83% mplus-intercom-subscription

Code Review | Intercom Live chat and Lead generation by 79mplus

WordPress plugin Intercom Live chat and Lead generation by 79mplus scored83%from 54 tests.

About plugin

  • Plugin page: mplus-intercom-su...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2018
  • Latest release: Sep 8, 2023
  • Number of updates: 27
  • Update frequency: every 72.6 days
  • Top authors: 79mplus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,179 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.05MB] [CPU: ▼3.01ms] Passed 4 tests

An overview of server-side resources used by Intercom Live chat and Lead generation by 79mplus
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.17 ▲3.73
Dashboard /wp-admin3.35 ▲0.0546.07 ▼0.56
Posts /wp-admin/edit.php3.47 ▲0.1146.57 ▼1.10
Add New Post /wp-admin/post-new.php5.96 ▲0.0792.56 ▼11.90
Media Library /wp-admin/upload.php3.28 ▲0.0535.67 ▲1.51
Intercom Subscription /wp-admin/admin.php?page=mplusis-settings3.2643.67
License Activation /wp-admin/admin.php?page=mplusis-license-activation3.2431.43

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Intercom Live chat and Lead generation by 79mplus
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.28 ▼1.014.42 ▲2.7340.84 ▼4.78
Dashboard /wp-admin2,237 ▲454.90 ▼0.05134.70 ▲18.0562.94 ▲23.25
Posts /wp-admin/edit.php2,122 ▲332.03 ▼0.0239.74 ▲0.0134.88 ▲1.23
Add New Post /wp-admin/post-new.php1,554 ▲1223.22 ▲5.04672.51 ▲80.0553.07 ▼2.38
Media Library /wp-admin/upload.php1,422 ▲314.12 ▼0.0794.56 ▼1.2464.39 ▲23.21
Intercom Subscription /wp-admin/admin.php?page=mplusis-settings9971.8826.9528.47
License Activation /wp-admin/admin.php?page=mplusis-license-activation7982.0223.7726.86

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 214× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mplus-intercom-subscription/vendor/intercom/intercom-php/test/IntercomCompaniesTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Exception' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/message/src/Exception/UnexpectedValueException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mplus-intercom-subscription/vendor/intercom/intercom-php/test/IntercomTagsTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Authentication' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/message/src/Authentication/Wsse.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Authentication' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/message/src/Authentication/Matching.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Exception\\TransferException' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Common\\HttpClientPool\\HttpClientPool' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mplus-intercom-subscription/vendor/intercom/intercom-php/test/IntercomCountsTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Promise\\Promise' not found in wp-content/plugins/mplus-intercom-subscription/vendor/php-http/promise/src/RejectedPromise.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: marketing, grow, user base, communication, lead...

mplus-intercom-subscription/mplus-intercom-subscription.php 92% from 13 tests

This is the main PHP file of "Intercom Live chat and Lead generation by 79mplus" version 2.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 204 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin45,197 lines of code in 465 files:
LanguageFilesBlank linesComment linesLines of code
PHP3754,88511,94636,704
Markdown412,17605,242
JSON29002,854
YAML12365165
CSS19482
JavaScript24080
XML35051
Dockerfile18010
make1409

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.17
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces48
Interfaces49
Traits13
Classes263
▷ Abstract classes51.90%
▷ Concrete classes25898.10%
▷ Final classes11644.96%
Methods1,485
▷ Static methods21514.48%
▷ Public methods1,25984.78%
▷ Protected methods332.22%
▷ Private methods19313.00%
Functions244
▷ Named functions9639.34%
▷ Anonymous functions14860.66%
Constants217
▷ Global constants8539.17%
▷ Class constants13260.83%
▷ Public constants13199.24%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.55MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin-icon.png1.31KB0.67KB▼ 48.95%
assets/screenshot-1.png333.25KB91.94KB▼ 72.41%
assets/screenshot-4.png17.46KB5.32KB▼ 69.51%
assets/screenshot-5.png51.56KB20.69KB▼ 59.88%
assets/screenshot-3.png28.34KB10.47KB▼ 63.06%