73% traffic

Code Review | Traffic

WordPress plugin Traffic scored73%from 54 tests.

About plugin

  • Plugin page: traffic
  • Plugin version: 2.11.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2019
  • Latest release: Oct 25, 2023
  • Number of updates: 37
  • Update frequency: every 40.1 days
  • Top authors: PierreLannoy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /13,208 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.20MB] [CPU: ▲4.42ms] Passed 4 tests

This is a short check of server-side resources used by Traffic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.53 ▲1.0644.47 ▲8.28
Dashboard /wp-admin4.56 ▲1.2652.75 ▲7.74
Posts /wp-admin/edit.php4.65 ▲1.2952.71 ▲1.98
Add New Post /wp-admin/post-new.php7.14 ▲1.2588.44 ▼0.31
Media Library /wp-admin/upload.php4.46 ▲1.2349.65 ▲15.13
API Traffic /wp-admin/admin.php?page=traffic-viewer5.1850.06
Traffic /wp-admin/admin.php?page=traffic-settings4.6345.56
Analytics /wp-admin/admin.php?page=perfopsone-analytics4.4342.26
Live API Calls /wp-admin/admin.php?page=traffic-console4.4241.39
Consoles /wp-admin/admin.php?page=perfopsone-consoles4.4336.76
Control Center /wp-admin/admin.php?page=perfopsone-dashboard4.4641.57

Server storage [IO: ▲2.58MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 503 new files
Database: 1 new table, 6 new options
New tables
wp_traffic_statistics
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Traffic
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11214.18 ▼0.181.74 ▲0.0940.17 ▲0.36
Dashboard /wp-admin2,242 ▲625.70 ▲0.0483.37 ▼1.4538.80 ▼5.48
Posts /wp-admin/edit.php2,145 ▲452.02 ▲0.0535.83 ▼0.0534.84 ▲0.75
Add New Post /wp-admin/post-new.php1,550 ▲1323.09 ▼0.09677.37 ▲8.6653.75 ▼12.02
Media Library /wp-admin/upload.php1,444 ▲444.24 ▲0.0494.86 ▼6.8241.83 ▼1.90
API Traffic /wp-admin/admin.php?page=traffic-viewer1,8544.58125.0978.31
Traffic /wp-admin/admin.php?page=traffic-settings1,1872.0125.9032.98
Analytics /wp-admin/admin.php?page=perfopsone-analytics8962.1526.6429.99
Live API Calls /wp-admin/admin.php?page=traffic-console9002.1331.2840.80
Consoles /wp-admin/admin.php?page=perfopsone-consoles9002.1522.3822.73
Control Center /wp-admin/admin.php?page=perfopsone-dashboard1,0712.0124.0331.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=perfopsone-analytics
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=traffic-console
    • > Warning in wp-content/plugins/traffic/includes/system/class-sharedmemory.php+96
    shmop_open(): unable to attach or create shared memory segment 'No such file or directory'

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/traffic/public/partials/traffic-public-display.php
  • 52× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\Mutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/NoMutex.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\LockMutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/SemaphoreMutex.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\RedisMutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/PredisMutex.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\exception\\MutexException' not found in wp-content/plugins/traffic/includes/libraries/lock/exception/LockReleaseException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\Mutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/LockMutex.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\SpinlockMutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/RedisMutex.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/traffic/admin/partials/traffic-admin-settings-main.php:14
    • > PHP Warning
      Use of undefined constant TRAFFIC_SLUG - assumed 'TRAFFIC_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/traffic/includes/system/class-environment.php on line 37
    • > PHP Fatal error
      Uncaught Error: Class 'malkusch\\lock\\mutex\\LockMutex' not found in wp-content/plugins/traffic/includes/libraries/lock/mutex/PgAdvisoryLockMutex.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/traffic/admin/partials/traffic-admin-view-analytics.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 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, rest-api, statistics, analytics, reports

traffic/traffic.php Passed 13 tests

"Traffic" version 2.11.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
56 characters long description:
Full featured monitoring & analytics for WordPress APIs.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin40,425 lines of code in 471 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript202,2733,00022,350
PHP1381,4908,26511,264
SVG285014,251
CSS19322102,038
Markdown71960469
JSON20053

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.02
▷ Minimum class complexity1.00
▷ Maximum class complexity289.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity87.00
Code structure
Namespaces18
Interfaces14
Traits15
Classes94
▷ Abstract classes66.38%
▷ Concrete classes8893.62%
▷ Final classes11.14%
Methods732
▷ Static methods24433.33%
▷ Public methods52371.45%
▷ Protected methods12116.53%
▷ Private methods8812.02%
Functions30
▷ Named functions1136.67%
▷ Anonymous functions1963.33%
Constants69
▷ Global constants5072.46%
▷ Class constants1927.54%
▷ Public constants1684.21%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected