84% pirsch-analytics

Code Review | Pirsch Analytics

WordPress plugin Pirsch Analytics scored84%from 54 tests.

About plugin

  • Plugin page: pirsch-analytics
  • Plugin version: 1.6.4
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 23, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 57
  • Update frequency: every 16.2 days
  • Top authors: m5blum (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /3,209 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.83ms] Passed 4 tests

This is a short check of server-side resources used by Pirsch Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.89 ▼1.43
Dashboard /wp-admin3.31 ▼0.0447.61 ▼16.64
Posts /wp-admin/edit.php3.36 ▲0.0049.05 ▼3.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.43 ▲3.61
Media Library /wp-admin/upload.php3.23 ▲0.0037.37 ▼2.18

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 322 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Pirsch Analytics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.001.85 ▲0.0442.07 ▲0.50
Dashboard /wp-admin2,198 ▲215.65 ▼0.0392.60 ▼1.9537.06 ▼2.56
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0039.95 ▼1.3636.79 ▼1.21
Add New Post /wp-admin/post-new.php1,526 ▼617.65 ▼5.66686.50 ▲77.0854.76 ▼1.38
Media Library /wp-admin/upload.php1,400 ▼04.22 ▼0.07100.72 ▼2.7846.60 ▼1.84

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • 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
Even though everything seems fine, this is not an exhaustive test

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
  • 102× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/pirsch-analytics/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/pirsch-analytics/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\MessageFormatterInterface' not found in wp-content/plugins/pirsch-analytics/vendor/guzzlehttp/guzzle/src/MessageFormatter.php:38
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/guzzlehttp/psr7/src/ServerRequest.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php:7
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/pirsch-analytics/vendor/pirsch-analytics/sdk/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/pirsch-analytics/vendor/guzzlehttp/psr7/src/PumpStream.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: api, pirsch, client, sdk, analytics

pirsch-analytics/pirsch-wordpress.php 85% from 13 tests

"Pirsch Analytics" version 1.6.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pirsch-analytics.php" instead of "pirsch-wordpress.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.1" instead of "5.2")

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
Good job! No executable or dangerous file extensions detected16,923 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1292,2835,53711,130
Markdown191,52904,053
JSON12001,740

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity13.47
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces12
Interfaces52
Traits6
Classes159
▷ Abstract classes00.00%
▷ Concrete classes159100.00%
▷ Final classes7044.03%
Methods1,548
▷ Static methods29018.73%
▷ Public methods1,30083.98%
▷ Protected methods80.52%
▷ Private methods24015.50%
Functions225
▷ Named functions4118.22%
▷ Anonymous functions18481.78%
Constants171
▷ Global constants00.00%
▷ Class constants171100.00%
▷ Public constants14987.13%

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