10% application-insights-dashboard-remake

Code Review | Azure App Insights plugin

WordPress plugin Azure App Insights plugin scored 10% from 54 tests.

About plugin

  • Plugin page: application-insig...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.1
  • WordPress version: 6.3.1
  • First release: Oct 8, 2015
  • Latest release: Feb 2, 2016
  • Number of updates: 10
  • Update frequency: every 13.1 days
  • Top authors: Bluefireray (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,407 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
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/application-insights-dashboard-remake/admin/Server_Instrumentation.php+16
    Undefined index: instrumentation_key

Server metrics [RAM: ▼1.64MB] [CPU: ▼48.26ms] Passed 4 tests

An overview of server-side resources used by Azure App Insights plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼1.1210.50 ▼34.53
Dashboard /wp-admin2.36 ▼0.9410.39 ▼36.90
Posts /wp-admin/edit.php2.36 ▼0.9910.50 ▼37.71
Add New Post /wp-admin/post-new.php2.36 ▼3.5212.22 ▼83.90
Media Library /wp-admin/upload.php2.36 ▼0.8710.03 ▼24.07
Application Insights Dashboard /wp-admin/options-general.php?page=appinsights2.3610.89

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 77 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
appinsights_options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Azure App Insights plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲15513.89 ▼0.687.37 ▲5.5945.32 ▼1.96
Dashboard /wp-admin2,278 ▲935.47 ▲0.58113.83 ▲12.8439.74 ▼1.90
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0439.76 ▲5.5633.34 ▼2.53
Add New Post /wp-admin/post-new.php1,545 ▲2218.15 ▼5.26605.66 ▼46.1555.28 ▼1.80
Media Library /wp-admin/upload.php1,392 ▲14.22 ▼0.1594.54 ▼1.2042.14 ▼0.23
Application Insights Dashboard /wp-admin/options-general.php?page=appinsights8322.0627.2927.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/application-insights-dashboard-remake/admin/Server_Instrumentation.php+16
    Undefined index: instrumentation_key
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=appinsights
    • > Notice in wp-content/plugins/application-insights-dashboard-remake/admin/Server_Instrumentation.php+16
    Undefined index: instrumentation_key
    • > GET request to /wp-admin/options-general.php?page=appinsights
    • > Notice in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-settings.php+40
    Undefined index: code

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/application-insights-dashboard-remake/appinsights.php
  • 26× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php on line 51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/application-insights-dashboard-remake/appinsights-api.php:25
    • > PHP Notice
      Undefined variable: period in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php on line 2
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/application-insights-dashboard-remake/vendor/microsoft/application-insights/ApplicationInsights/Tests/Channel/Contracts/Utils_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/application-insights-dashboard-remake/vendor/microsoft/application-insights/ApplicationInsights/Tests/Channel/Telemetry_Channel_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php:56
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php on line 38
    • > PHP Notice
      Undefined variable: period in wp-content/plugins/application-insights-dashboard-remake/admin/appinsights-ajax.php on line 10
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/application-insights-dashboard-remake/appinsights-api.php on line 24

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: appinsights, microsoft azure, application insights, windows azure

application-insights-dashboard-remake/appinsights.php 92% from 13 tests

The main PHP script in "Azure App Insights plugin" version 1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("application-insights-dashboard-remake.php" instead of "appinsights.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin25,154 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript103,5251,66020,392
PHP548011,4963,980
CSS2181152495
XML302110
Markdown1310109
JSON20068

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.14
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes51
▷ Abstract classes11.96%
▷ Concrete classes5098.04%
▷ Final classes00.00%
Methods408
▷ Static methods266.37%
▷ Public methods39195.83%
▷ Protected methods51.23%
▷ Private methods122.94%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin