78% wecantrack

Code Review | Affiliate Sales in Google Analytics and other tools

WordPress plugin Affiliate Sales in Google Analytics and other tools scored78%from 54 tests.

About plugin

  • Plugin page: wecantrack
  • Plugin version: 1.4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: Aug 17, 2023
  • Number of updates: 41
  • Update frequency: every 29.4 days
  • Top authors: wecantrack (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /16,666 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.56ms] Passed 4 tests

A check of server-side resources used by Affiliate Sales in Google Analytics and other tools
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.50 ▼4.66
Dashboard /wp-admin3.40 ▲0.0945.47 ▼6.80
Posts /wp-admin/edit.php3.51 ▲0.1548.52 ▲0.93
Add New Post /wp-admin/post-new.php5.98 ▲0.0991.50 ▼3.70
Media Library /wp-admin/upload.php3.32 ▲0.0936.78 ▲2.14
WeCanTrack /wp-admin/admin.php?page=wecantrack3.3132.36
Redirect Page /wp-admin/admin.php?page=wecantrack-redirect-page3.3134.28
Settings /wp-admin/admin.php?page=wecantrack-advanced-settings3.3131.18

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 19 new options
New WordPress options
wecantrack_referrer_cookie_status
widget_theysaidso_widget
wecantrack_snippet_version
can_compress_scripts
wecantrack_custom_redirect_html
wecantrack_fetch_expiration
wecantrack_api_key
widget_recent-comments
theysaidso_admin_options
wecantrack_snippet
...

Browser metrics Passed 4 tests

A check of browser resources used by Affiliate Sales in Google Analytics and other tools
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9514.47 ▲0.091.56 ▼0.2638.09 ▼12.19
Dashboard /wp-admin2,236 ▲485.80 ▼0.10112.09 ▼3.9478.99 ▲32.30
Posts /wp-admin/edit.php2,119 ▲302.00 ▼0.0439.25 ▲3.0937.62 ▲3.13
Add New Post /wp-admin/post-new.php1,548 ▲3418.47 ▲0.98690.20 ▲9.8266.76 ▲9.40
Media Library /wp-admin/upload.php1,415 ▲304.25 ▲0.0097.19 ▼1.7771.26 ▲25.85
WeCanTrack /wp-admin/admin.php?page=wecantrack1,0221.7624.5926.83
Redirect Page /wp-admin/admin.php?page=wecantrack-redirect-page1,0081.7224.2330.79
Settings /wp-admin/admin.php?page=wecantrack-advanced-settings9781.8627.1324.86

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wecantrack_referrer_cookie_status
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wecantrack/wecantrack.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wecantrack/views/redirect_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wecantrack/views/advanced_settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wecantrack/views/settings.php:3

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

wecantrack/wecantrack.php 92% from 13 tests

Analyzing the main PHP file in "Affiliate Sales in Google Analytics and other tools" version 1.4.5
The following require your attention:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.6.20" instead of "5.6")

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
There were no executable files found in this plugin1,506 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP92101621,111
JavaScript33824246
CSS112166
SVG10066
Markdown113017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity37.75
▷ Minimum class complexity8.00
▷ Maximum class complexity92.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods2046.51%
▷ Public methods3376.74%
▷ Protected methods00.00%
▷ Private methods1023.26%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
images/favicon2.png6.05KB3.87KB▼ 36.01%
images/favicon.png1.36KB0.91KB▼ 32.85%