57% intelligence

Code Review | Intelligence

WordPress plugin Intelligence scored 57% from 54 tests.

About plugin

  • Plugin page: intelligence
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: Aug 5, 2023
  • Number of updates: 88
  • Update frequency: every 25.9 days
  • Top authors: tomdude (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 16,234 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲2.92MB] [CPU: ▲14.91ms] Passed 4 tests

This is a short check of server-side resources used by Intelligence
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.53 ▲3.0762.91 ▲19.18
Dashboard /wp-admin6.45 ▲3.1568.87 ▲17.16
Posts /wp-admin/edit.php6.41 ▲3.0672.90 ▲26.83
Add New Post /wp-admin/post-new.php8.67 ▲2.79105.28 ▲3.88
Media Library /wp-admin/upload.php6.01 ▲2.7856.66 ▲19.43
Dashboard /wp-admin/admin.php?page=intel_admin6.6557.12
Reports /wp-admin/admin.php?page=intel_reports6.6555.66
Contacts /wp-admin/admin.php?page=intel_visitor6.7555.41
Annotations /wp-admin/admin.php?page=intel_annotation7.2756.14
Help /wp-admin/admin.php?page=intel_help6.7350.47
Utilities /wp-admin/admin.php?page=intel_util6.8254.74
Settings /wp-admin/admin.php?page=intel_config7.7859.97

Server storage [IO: ▲8.17MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 784 new files
Database: 6 new tables, 11 new options
New tables
wp_intel_value_str
wp_intel_visitor_identifier
wp_intel_annotation
wp_intel_submission
wp_intel_visitor
wp_intel_entity_attr
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
intel_system_meta
intel_system
theysaidso_admin_options
intel_entity_settings_taxonomy__post_tag
intel_entity_settings_taxonomy__category
widget_recent-comments
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Intelligence
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲20613.67 ▼0.715.31 ▲3.2937.65 ▼2.85
Dashboard /wp-admin2,250 ▲625.83 ▲0.73106.30 ▲1.7339.48 ▼1.83
Posts /wp-admin/edit.php2,164 ▲932.03 ▲0.0441.28 ▲3.2036.41 ▼1.36
Add New Post /wp-admin/post-new.php1,579 ▲4318.32 ▼4.97611.15 ▼42.7662.18 ▲9.63
Media Library /wp-admin/upload.php1,435 ▲474.37 ▲0.1297.43 ▼15.0043.73 ▼0.16
Dashboard /wp-admin/admin.php?page=intel_admin1,0481.8927.9034.24
Reports /wp-admin/admin.php?page=intel_reports1,0481.8030.4637.38
Contacts /wp-admin/admin.php?page=intel_visitor9301.9427.7230.57
Annotations /wp-admin/admin.php?page=intel_annotation8911.8225.7529.94
Help /wp-admin/admin.php?page=intel_help9061.8027.0229.33
Utilities /wp-admin/admin.php?page=intel_util9131.8025.5033.46
Settings /wp-admin/admin.php?page=intel_config9511.8026.7332.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 6 tables
    • wp_intel_entity_attr
    • wp_intel_annotation
    • wp_intel_visitor
    • wp_intel_submission
    • wp_intel_value_str
    • wp_intel_visitor_identifier
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • db_upgraded
    • intel_entity_settings_taxonomy__category
    • widget_recent-comments
    • intel_system_meta
    • widget_theysaidso_widget
    • intel_entity_settings_taxonomy__post_tag
    • can_compress_scripts
    • intel_entity_settings_taxonomy__post_format
    • widget_recent-posts
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 29× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/intelligence/templates/intel-page.tpl.php
    • > /wp-content/plugins/intelligence/admin/partials/intel-admin-display.php
    • > /wp-content/plugins/intelligence/templates/intel-visitor-profile.tpl.php
    • > /wp-content/plugins/intelligence/templates/intel-shortcode.tpl.php
    • > /wp-content/plugins/intelligence/vendor/google/apiclient/examples/idtoken.php
    • > /wp-content/plugins/intelligence/templates/intel-visitor-profile-item.tpl.php
    • > /wp-content/plugins/intelligence/public/partials/intel-public-display.php
    • > /wp-content/plugins/intelligence/vendor/levelten/intel/realtime/reports/includes/rtd.main-screen.php
    • > /wp-content/plugins/intelligence/templates/intel-visitor-location.tpl.php
    • > /wp-content/plugins/intelligence/vendor/kint/Kint.class.php
  • 4095× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8
    • > PHP Warning
      readdir() expects parameter 1 to be resource, bool given in wp-content/plugins/intelligence/vendor/kint/examples/overview.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in intelligence/assets to your readme.txt
The official readme.txt might help

intelligence/intel.php 85% from 13 tests

"Intelligence" version 1.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("intelligence.php" instead of "intel.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .reg - Registry Data File in Windows
      • wp-content/plugins/intelligence/vendor/kint/scripts/source.reg
    • .vbs - VBScript File in Windows
      • wp-content/plugins/intelligence/vendor/kint/scripts/source.vbs
136,341 lines of code in 668 files:
LanguageFilesBlank linesComment linesLines of code
PHP45311,37327,17171,583
JavaScript927,3966,00534,483
CSS5944318725,599
LESS10209641,461
Markdown1235601,127
JSON10150599
HTML1421217563
SVG200338
Pascal683353332
XML42842135
YAML420174
Visual Basic1142442
INI1015

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.07
▷ Minimum class complexity1.00
▷ Maximum class complexity574.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces13
Interfaces11
Traits1
Classes417
▷ Abstract classes81.92%
▷ Concrete classes40998.08%
▷ Final classes20.49%
Methods3,588
▷ Static methods3289.14%
▷ Public methods3,35893.59%
▷ Protected methods922.56%
▷ Private methods1383.85%
Functions865
▷ Named functions83095.95%
▷ Anonymous functions354.05%
Constants144
▷ Global constants5538.19%
▷ Class constants8961.81%
▷ Public constants89100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 PNG files occupy 0.30MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/setup_start_action.png3.74KB2.16KB▼ 42.31%
vendor/TimelineJS/compiled/css/timeline@2x.png48.21KB22.30KB▼ 53.74%
vendor/TimelineJS/compiled/css/timeline.png19.41KB9.89KB▼ 49.01%
images/setup_scoring_action.png8.50KB3.49KB▼ 59.00%
vendor/levelten/intel/images/logo_stacked_light.png13.55KB6.59KB▼ 51.34%