78% utm-switcher

Code Review | UTM Switcher

WordPress plugin UTM Switcher scored78%from 54 tests.

About plugin

  • Plugin page: utm-switcher
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.5.2
  • WordPress version: 6.3.1
  • First release: May 18, 2016
  • Latest release: May 18, 2016
  • Number of updates: 5
  • Update frequency: every 1.6 days
  • Top authors: punchrockgroin (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

80+ active /1,985 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.63MB] [CPU: ▲5.42ms] Passed 4 tests

An overview of server-side resources used by UTM Switcher
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3750.87 ▲4.40
Dashboard /wp-admin4.08 ▲0.7761.10 ▲7.25
Posts /wp-admin/edit.php4.13 ▲0.7758.42 ▲13.95
Add New Post /wp-admin/post-new.php6.59 ▲0.7090.38 ▼0.21
Media Library /wp-admin/upload.php3.91 ▲0.6843.59 ▲10.22
Help /wp-admin/edit.php?post_type=utm_switcher&page=utm_switcher_ref_general3.9140.02
Help /wp-admin/admin.php?page=utm_switcher_ref_cf73.9138.83
All UTM Switchers /wp-admin/edit.php?post_type=utm_switcher3.9843.98
Add New /wp-admin/post-new.php?post_type=utm_switcher3.9850.41

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 142 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for UTM Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33215.40 ▲1.026.90 ▲5.2236.98 ▼8.16
Dashboard /wp-admin2,400 ▲2126.68 ▲0.81133.56 ▲19.2941.62 ▼5.48
Posts /wp-admin/edit.php2,308 ▲2193.57 ▲1.5254.70 ▲16.7934.47 ▼1.86
Add New Post /wp-admin/post-new.php1,563 ▲2923.43 ▲0.16652.53 ▼38.6036.94 ▼23.27
Media Library /wp-admin/upload.php1,439 ▲544.34 ▲0.1485.33 ▼14.4544.53 ▲2.12
Help /wp-admin/edit.php?post_type=utm_switcher&page=utm_switcher_ref_general1,0793.3638.9526.91
Help /wp-admin/admin.php?page=utm_switcher_ref_cf71,0813.2739.8425.39
All UTM Switchers /wp-admin/edit.php?post_type=utm_switcher1,2833.4949.8528.33
Add New /wp-admin/post-new.php?post_type=utm_switcher1,7704.0967.4140.32

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/tests/bootstrap.php
    • > /wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 66× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Container/Nav_Menu_Container.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Post_Meta_Datastore' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Datastore/Nav_Menu_Datastore.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Field/Textarea_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Container/Widget_Container.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Select_Field' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Field/Sidebar_Field.php:5
    • > PHP Notice
      Undefined variable: errors in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php on line 35
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/tests/bootstrap.php on line 45
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Map_Field' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Field/Map_With_Address_Field.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Datastore' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Datastore/Comment_Meta_Datastore.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/utm-switcher/vendor/htmlburger/carbon-fields/core/Field/Text_Field.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors not specified
You can look at the official readme.txt

utm-switcher/utm-switcher.php Passed 13 tests

The main PHP script in "UTM Switcher" version 1.0.2 is automatically included on every request by WordPress
125 characters long description:
Allows GET variables from Social Media Campaigns to modify content based on criteria. Also, adds these variables to CF7 Forms

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin9,159 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
PHP861,6643,5775,732
JavaScript98246682,571
CSS28766302
JSON400205
PO File17579193
Bourne Shell1202064
YAML29048
Markdown219026
XML10018

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.05
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces11
Interfaces1
Traits0
Classes63
▷ Abstract classes34.76%
▷ Concrete classes6095.24%
▷ Final classes00.00%
Methods516
▷ Static methods479.11%
▷ Public methods49896.51%
▷ Protected methods81.55%
▷ Private methods101.94%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants12
▷ Global constants758.33%
▷ Class constants541.67%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.53MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png10.22KB9.63KB▼ 5.77%
assets/icon-128x128.png19.97KB9.40KB▼ 52.95%
assets/banner-772x250.png4.73KB5.06KB0.00%
assets/icon-256x256.png55.12KB25.56KB▼ 53.62%
assets/screenshot-1.png450.52KB105.76KB▼ 76.52%