84% trafficmanager-wc

Code Review | TrafficManager WC

WordPress plugin TrafficManager WC scored84%from 54 tests.

About plugin

  • Plugin page: trafficmanager-wc
  • Plugin version: 1.4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2021
  • Latest release: May 1, 2023
  • Number of updates: 25
  • Update frequency: every 36.6 days
  • Top authors: trafficmanager (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /993 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.44ms] Passed 4 tests

Server-side resources used by TrafficManager WC
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.29 ▲0.50
Dashboard /wp-admin3.32 ▼0.0346.14 ▼11.68
Posts /wp-admin/edit.php3.37 ▲0.0147.55 ▼4.19
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.49 ▼15.45
Media Library /wp-admin/upload.php3.24 ▲0.0132.42 ▼2.42

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for TrafficManager WC
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.164.40 ▲2.6442.47 ▼0.61
Dashboard /wp-admin2,206 ▲184.87 ▼0.02109.15 ▼0.4137.50 ▼2.50
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0336.73 ▲0.2631.84 ▼0.14
Add New Post /wp-admin/post-new.php1,538 ▲1923.33 ▼0.04649.52 ▼56.9851.96 ▼4.10
Media Library /wp-admin/upload.php1,388 ▼34.18 ▼0.0197.40 ▼2.3644.85 ▲2.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/trafficmanager-wc/integration.php:10

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woocommerce, trafficmanager, postback, affiliate postback, trafficmanagercom

trafficmanager-wc/trafficmanager-plugin.php 92% from 13 tests

The main file in "TrafficManager WC" v. 1.4.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("trafficmanager-wc.php" instead of "trafficmanager-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected340 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP290106331
Markdown1509

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity32.00
▷ Minimum class complexity3.00
▷ Maximum class complexity61.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods1583.33%
▷ Protected methods00.00%
▷ Private methods316.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin