10% application-insights

Code Review | Application Insights

WordPress plugin Application Insights scored 10% from 54 tests.

About plugin

  • Plugin page: application-insights
  • Plugin version: 2.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Sep 18, 2014
  • Latest release: May 27, 2018
  • Number of updates: 22
  • Update frequency: every 61.4 days
  • Top authors: ApplicationInsights (59.09%)JakubOleksy (45.45%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active / 9,554 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/application-insights/src/Server_Instrumentation.php+24
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.79ms] Passed 4 tests

An overview of server-side resources used by Application Insights
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.15 ▼36.99
Dashboard /wp-admin2.05 ▼1.267.33 ▼38.31
Posts /wp-admin/edit.php2.05 ▼1.317.61 ▼38.64
Add New Post /wp-admin/post-new.php2.05 ▼3.846.63 ▼85.20
Media Library /wp-admin/upload.php2.05 ▼1.186.24 ▼30.64
Application Insights /wp-admin/options-general.php?page=applicationinsights-setting-admin2.056.29

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Application Insights
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲5213.68 ▼0.639.68 ▲7.5750.48 ▲2.48
Dashboard /wp-admin2,210 ▲194.87 ▼0.19103.34 ▲1.3240.77 ▼4.76
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0235.42 ▲2.0533.72 ▼0.14
Add New Post /wp-admin/post-new.php1,517 ▲317.84 ▲0.16675.13 ▼46.9061.72 ▼1.22
Media Library /wp-admin/upload.php1,389 ▲44.24 ▲0.00102.81 ▲0.0143.49 ▼3.87
Application Insights /wp-admin/options-general.php?page=applicationinsights-setting-admin7772.0323.5923.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/application-insights/src/Server_Instrumentation.php+24
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=applicationinsights-setting-admin
    • > Notice in wp-content/plugins/application-insights/src/Server_Instrumentation.php+24
    Trying to access array offset on value of type bool

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
  • 73× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/promises/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ApplicationInsights\\Channel\\Contracts\\Base_Data' not found in wp-content/plugins/application-insights/vendor/microsoft/application-insights/ApplicationInsights/Channel/Contracts/Request_Data.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/application-insights/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/psr7/src/PumpStream.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'ApplicationInsights\\Channel\\Contracts\\Data_Interface' not found in wp-content/plugins/application-insights/vendor/microsoft/application-insights/ApplicationInsights/Channel/Contracts/Base_Data.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/application-insights/vendor/microsoft/application-insights/Tests/Channel/Contracts/Utils_Test.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/application-insights/vendor/guzzlehttp/psr7/src/BufferStream.php:14

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: telemetry, tracing, monitoring, application insights

application-insights/ApplicationInsightsPlugin.php 92% from 13 tests

The main PHP file in "Application Insights" ver. 2.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("application-insights.php" instead of "ApplicationInsightsPlugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected14,291 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1342,1216,02610,340
Markdown1499603,328
JSON710466
XML302111
YAML23037
make1409

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.90
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces14
Interfaces15
Traits4
Classes102
▷ Abstract classes43.92%
▷ Concrete classes9896.08%
▷ Final classes77.14%
Methods964
▷ Static methods838.61%
▷ Public methods84787.86%
▷ Protected methods90.93%
▷ Private methods10811.20%
Functions142
▷ Named functions5438.03%
▷ Anonymous functions8861.97%
Constants58
▷ Global constants00.00%
▷ Class constants58100.00%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected