92% indicative-analytics

Code Review | Indicative Analytics

WordPress plugin Indicative Analytics scored 92% from 54 tests.

About plugin

  • Plugin page: indicative-analytics
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.3.2
  • WordPress version: 5.9.2
  • First release: Mar 28, 2019
  • Latest release: Nov 20, 2020
  • Number of updates: 34
  • Update frequency: every 17.8 days
  • Top authors: indicativejeremy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 792 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼303.23ms] Passed 4 tests

An overview of server-side resources used by Indicative Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.10 ▼0.4119.65 ▼30.47
Dashboard /wp-admin3.60 ▲0.1932.17 ▼0.96
Posts /wp-admin/edit.php3.81 ▲0.1736.21 ▲0.38
Add New Post /wp-admin/post-new.php7.45 ▲0.4880.92 ▼1,181.47
Media Library /wp-admin/upload.php3.55 ▲0.2623.02 ▼0.03
Log /wp-admin/admin.php?page=indicative-log3.5021.89
Settings /wp-admin/admin.php?page=indicative-settings4.8040.44

Server storage [IO: ▲3.96MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • You have illegally modified 1 file (4.26KB) outside of "wp-content/plugins/indicative-analytics/" and "wp-content/uploads/"
    • (modified) wp-config.php
Filesystem: 1,008 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Indicative Analytics: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,981 ▲23716.76 ▲1.079.56 ▲3.492.72 ▲0.55
Dashboard /wp-admin2,970 ▲1166.06 ▼0.15116.52 ▼20.18199.00 ▲38.96
Posts /wp-admin/edit.php2,766 ▲723.24 ▼0.1261.04 ▼5.36157.52 ▲16.80
Add New Post /wp-admin/post-new.php1,811 ▲15022.81 ▲7.22424.02 ▼21.42154.10 ▼1.77
Media Library /wp-admin/upload.php1,773 ▲785.54 ▲0.00125.83 ▼11.60219.49 ▲34.48
Log /wp-admin/admin.php?page=indicative-log1,0972.3753.50127.08
Settings /wp-admin/admin.php?page=indicative-settings1,3512.3852.26141.81

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 458× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\Carbon' not found in wp-content/plugins/indicative-analytics/vendor/illuminate/support/Carbon.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/indicative-analytics/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Exception\\ExceptionInterface' not found in wp-content/plugins/indicative-analytics/vendor/symfony/translation/Exception/NotFoundResourceException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Database\\Console\\Migrations\\BaseCommand' not found in wp-content/plugins/indicative-analytics/vendor/illuminate/database/Console/Migrations/ResetCommand.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/indicative-analytics/vendor/symfony/translation/Dumper/QtFileDumper.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\\TimeConverterInterface' not found in wp-content/plugins/indicative-analytics/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Finder\\Tests\\Iterator\\RealIteratorTestCase' not found in wp-content/plugins/indicative-analytics/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Translator' not found in wp-content/plugins/indicative-analytics/vendor/nesbot/carbon/src/Carbon/Translator.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Database\\Eloquent\\Model' not found in wp-content/plugins/indicative-analytics/vendor/illuminate/database/Eloquent/Relations/Pivot.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/indicative-analytics/vendor/illuminate/support/Facades/Gate.php:10

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)
No browser errors were detected

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Requires php: Invalid plugin version format
  • Contributors: Plugin contributors field is missing
  • Contributors: Please add at least on tag
You can look at the official readme.txt

indicative-analytics/indicative.php 77% from 13 tests

The entry point to "Indicative Analytics" version 1.8 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("indicative-analytics.php" instead of "indicative.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 259 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin74,138 lines of code in 928 files:
LanguageFilesBlank linesComment linesLines of code
PHP83015,59545,63761,934
XSD499764,991
Markdown281,36704,051
JSON28002,224
XML20300579
CSS2360250
PO File67037
JavaScript16028
YAML54021
Qt Linguist10010
make1409
Bourne Shell1203
INI1001

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 334)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.82
▷ Minimum class complexity1.00
▷ Maximum class complexity348.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity334.00
Code structure
Namespaces135
Interfaces136
Traits25
Classes590
▷ Abstract classes325.42%
▷ Concrete classes55894.58%
▷ Final classes101.79%
Methods6,404
▷ Static methods65210.18%
▷ Public methods5,12279.98%
▷ Protected methods1,02516.01%
▷ Private methods2574.01%
Functions559
▷ Named functions18132.38%
▷ Anonymous functions37867.62%
Constants250
▷ Global constants83.20%
▷ Class constants24296.80%
▷ Public constants242100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/indicative-logo.png5.02KB3.24KB▼ 35.49%
assets/img/indicative-menu-icon.png0.16KB0.12KB▼ 26.19%