82% application-insights-dashboard

Code Review | Application Insights Dashboard

WordPress plugin Application Insights Dashboard scored 82% from 53 tests.

About plugin

  • Plugin page: application-insig...
  • Plugin version: 1.0a
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0.1
  • WordPress version: 5.8.1
  • First release: Dec 18, 2014
  • Latest release: Dec 18, 2014
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: bibinkurian (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 593 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼264.49ms] Passed 4 tests

This is a short check of server-side resources used by Application Insights Dashboard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2036.77 ▲12.67
Dashboard /wp-admin3.16 ▲0.1045.92 ▼4.11
Posts /wp-admin/edit.php3.20 ▲0.0938.82 ▼8.87
Add New Post /wp-admin/post-new.php5.51 ▲0.0893.91 ▼1,036.13
Media Library /wp-admin/upload.php3.09 ▲0.0830.06 ▼8.85
Application Insights /wp-admin/options-general.php?page=appinsights3.2331.72

Server storage [IO: ▲0.87MB] [DB: ▲0.72MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 1 new option
New WordPress options
appinsights_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Application Insights Dashboard
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,788 ▲18216.52 ▲0.627.59 ▼2.0052.87 ▲0.63
Dashboard /wp-admin3,048 ▲1986.95 ▲1.08140.31 ▼0.5798.54 ▼7.70
Posts /wp-admin/edit.php2,711 ▲82.70 ▲0.0160.81 ▼10.5380.72 ▼20.20
Add New Post /wp-admin/post-new.php1,591 ▼44521.62 ▲3.55271.88 ▼79.28104.56 ▲3.17
Media Library /wp-admin/upload.php1,777 ▲55.00 ▼0.02138.84 ▼9.03106.69 ▼5.82
Application Insights /wp-admin/options-general.php?page=appinsights1,1042.5654.2674.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.72MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

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/admin/appinsights-settings.php+40
    Undefined index: code

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/application-insights-dashboard/appinsights.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/application-insights-dashboard/config.php:40
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/application-insights-dashboard/appinsights-api.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/application-insights-dashboard/appinsights-api.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/application-insights-dashboard/appinsights-api.php on line 24
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/application-insights-dashboard/appinsights-api.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/application-insights-dashboard/appinsights-api.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: microsoft azure, application insights

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

The main PHP script in "Application Insights Dashboard" version 1.0a is automatically included on every request by WordPress
It is important to fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "1.0a")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("application-insights-dashboard.php" instead of "appinsights.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
Success! There were no dangerous files found in this plugin13,661 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript103,52210,08611,947
PHP10207291,241
CSS2181152473

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods41
▷ Static methods512.20%
▷ Public methods3278.05%
▷ Protected methods00.00%
▷ Private methods921.95%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

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