78% intercom

Code Review | Intercom

WordPress plugin Intercom scored78%from 54 tests.

About plugin

  • Plugin page: intercom
  • Plugin version: 2.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 27, 2013
  • Latest release: May 10, 2022
  • Number of updates: 61
  • Update frequency: every 54.1 days
  • Top authors: bobintercom (98.36%)s3rgiosan (3.28%)

Code review

54 tests

User reviews

11 reviews

Install metrics

8,000+ active /158,843 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.01MB] [CPU: ▼6.08ms] Passed 4 tests

Analyzing server-side resources used by Intercom
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.02 ▼1.37
Dashboard /wp-admin3.31 ▲0.0149.77 ▲1.68
Posts /wp-admin/edit.php3.36 ▲0.0141.99 ▼5.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.50 ▼18.58
Media Library /wp-admin/upload.php3.23 ▲0.0132.82 ▲1.04
Intercom /wp-admin/options-general.php?page=intercom3.1729.92

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Intercom
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.71 ▼0.6710.28 ▲8.4341.24 ▼8.54
Dashboard /wp-admin2,207 ▲195.81 ▼0.0893.69 ▼3.4234.86 ▼5.28
Posts /wp-admin/edit.php2,090 ▲12.02 ▲0.0136.08 ▼1.3233.53 ▼0.25
Add New Post /wp-admin/post-new.php1,538 ▲2423.16 ▲5.59693.32 ▲36.2466.32 ▲14.30
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0494.58 ▼1.7845.14 ▲1.59
Intercom /wp-admin/options-general.php?page=intercom1,0701.9127.1768.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=intercom
    • > Notice in wp-content/plugins/intercom/bootstrap.php+507
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=intercom
    • > Notice in wp-content/plugins/intercom/bootstrap.php+219
    Undefined index: identity_verification

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/SecureModeCalulatorTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/SnippetSettingsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/UserTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/SettingsPageTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/ValidatorTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/intercom/test/SnippetTest.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === intercom === )
The official readme.txt might help

intercom/bootstrap.php 92% from 13 tests

This is the main PHP file of "Intercom" version 2.6.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("intercom.php" instead of "bootstrap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin700 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP77519647
Markdown121036
SVG1019
XML1108

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods49
▷ Static methods24.08%
▷ Public methods3775.51%
▷ Protected methods00.00%
▷ Private methods1224.49%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshots/widget.png25.00KB8.78KB▼ 64.86%
screenshots/settings.png56.66KB15.46KB▼ 72.72%
assets/banner-772x250.png13.97KB5.28KB▼ 62.19%
assets/banner-1544x500.png43.70KB14.75KB▼ 66.24%