84% microsoft-clarity

Code Review | Microsoft Clarity

WordPress plugin Microsoft Clarity scored84%from 54 tests.

About plugin

  • Plugin page: microsoft-clarity
  • Plugin version: 0.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 18, 2020
  • Latest release: Jul 25, 2023
  • Number of updates: 67
  • Update frequency: every 14.6 days
  • Top authors: salmaghoneim (80.6%)zoe7633 (16.42%)sammartin (4.48%)q3ahmed (2.99%)

Code review

54 tests

User reviews

7 reviews

Install metrics

50,000+ active /243,681 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.18ms] Passed 4 tests

Analyzing server-side resources used by Microsoft Clarity
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.38 ▼4.62
Dashboard /wp-admin3.34 ▲0.0347.48 ▼7.56
Posts /wp-admin/edit.php3.39 ▲0.0349.77 ▲0.74
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.26 ▼5.28
Media Library /wp-admin/upload.php3.26 ▲0.0343.01 ▲8.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
clarity_wordpress_site_id

Browser metrics Passed 4 tests

This is an overview of browser requirements for Microsoft Clarity
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.23 ▼1.141.66 ▼0.2031.22 ▼6.06
Dashboard /wp-admin2,247 ▲555.87 ▲0.90116.73 ▲11.5681.27 ▲44.74
Posts /wp-admin/edit.php2,131 ▲452.02 ▲0.0140.31 ▲4.6736.99 ▲2.62
Add New Post /wp-admin/post-new.php1,704 ▲19022.07 ▲4.52682.81 ▼20.2647.28 ▼17.67
Media Library /wp-admin/upload.php1,423 ▲354.22 ▲0.0295.72 ▼2.4775.46 ▲34.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • clarity_wordpress_site_id
    • theysaidso_admin_options
    • clarity_project_id
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/microsoft-clarity/clarity.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/microsoft-clarity/clarity_page.php:76

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: clarity, behavioral analytics, microsoft

microsoft-clarity/clarity.php 92% from 13 tests

The primary PHP file in "Microsoft Clarity" version 0.9.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("microsoft-clarity.php" instead of "clarity.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin252 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23080203
JavaScript13049

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin