83% user-insight

Code Review | User Insight WordPress Plugin

WordPress plugin User Insight WordPress Plugin scored 83% from 54 tests.

About plugin

  • Plugin page: user-insight
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 23, 2017
  • Latest release: Nov 2, 2021
  • Number of updates: 17
  • Update frequency: every 86.7 days
  • Top authors: userlocal (70.59%)koarakawa (35.29%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 2,996 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.10ms] Passed 4 tests

An overview of server-side resources used by User Insight WordPress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.85 ▼6.79
Dashboard /wp-admin3.33 ▲0.0251.33 ▲3.56
Posts /wp-admin/edit.php3.38 ▲0.0247.99 ▼0.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.27 ▼13.54
Media Library /wp-admin/upload.php3.25 ▲0.0236.65 ▲0.50

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

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

Browser metrics Passed 4 tests

User Insight WordPress Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.60 ▼1.171.82 ▲0.0843.07 ▼4.98
Dashboard /wp-admin2,219 ▲285.78 ▼0.1297.61 ▼3.6341.68 ▼5.15
Posts /wp-admin/edit.php2,105 ▲162.04 ▲0.0335.52 ▼4.2231.89 ▼4.42
Add New Post /wp-admin/post-new.php1,547 ▲3323.16 ▲5.69649.06 ▼11.4257.99 ▲0.97
Media Library /wp-admin/upload.php1,404 ▲194.18 ▲0.0096.85 ▼9.3139.90 ▼6.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-insight/user_insight.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/user-insight/view/admin.php:19

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

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Requires at least: Invalid version format
  • Donate link: Invalid URI found ("")
The official readme.txt might help

user-insight/user_insight.php 92% from 13 tests

This is the main PHP file of "User Insight WordPress Plugin" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("user-insight.php" instead of "user_insight.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
Good job! No executable or dangerous file extensions detected187 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32430186
CSS1051

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/logo.png3.46KB1.38KB▼ 59.96%