77% tracking-script-manager

Code Review | Tracking Script Manager

WordPress plugin Tracking Script Manager scored77%from 54 tests.

About plugin

  • Plugin page: tracking-script-m...
  • Plugin version: 2.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 1, 2014
  • Latest release: Nov 8, 2023
  • Number of updates: 86
  • Update frequency: every 39.4 days
  • Top authors: JHipkin (54.65%)red8developers (46.51%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /41,559 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▼1.29ms] Passed 4 tests

A check of server-side resources used by Tracking Script Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2240.28 ▲1.52
Dashboard /wp-admin3.53 ▲0.1846.95 ▼16.42
Posts /wp-admin/edit.php3.64 ▲0.2850.19 ▲5.43
Add New Post /wp-admin/post-new.php6.11 ▲0.2295.93 ▲7.57
Media Library /wp-admin/upload.php3.45 ▲0.2238.05 ▲4.32
Tracking Script Manager /wp-admin/edit.php?post_type=r8_tracking_scripts3.4938.33
Add New Tracking Script /wp-admin/post-new.php?post_type=r8_tracking_scripts3.6555.78

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Tracking Script Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5614.23 ▼0.041.59 ▼0.2035.78 ▼7.92
Dashboard /wp-admin2,220 ▲405.58 ▼0.0684.92 ▼13.8639.13 ▼4.18
Posts /wp-admin/edit.php2,128 ▲281.95 ▲0.0039.56 ▲4.0236.15 ▲2.27
Add New Post /wp-admin/post-new.php1,549 ▲1423.72 ▲0.58649.68 ▼39.8861.48 ▲4.07
Media Library /wp-admin/upload.php1,428 ▲284.16 ▼0.06109.50 ▲5.3648.29 ▲4.08
Tracking Script Manager /wp-admin/edit.php?post_type=r8_tracking_scripts1,1792.0235.6132.01
Add New Tracking Script /wp-admin/post-new.php?post_type=r8_tracking_scripts2,0295.58116.5046.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/tracking-script-manager/templates/script-active-metabox.php
    • > /wp-content/plugins/tracking-script-manager/templates/script-code-metabox.php
    • > /wp-content/plugins/tracking-script-manager/templates/script-order-metabox.php
    • > /wp-content/plugins/tracking-script-manager/templates/script-location-metabox.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tracking-script-manager/templates/script-expiry-metabox.php:3
    • > PHP Notice
      Undefined variable: location in wp-content/plugins/tracking-script-manager/templates/script-location-metabox.php on line 4
    • > PHP Notice
      Undefined variable: script_code in wp-content/plugins/tracking-script-manager/templates/script-code-metabox.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Async_Request' not found in wp-content/plugins/tracking-script-manager/classes/wp-background-process.php:16
    • > PHP Notice
      Undefined variable: active in wp-content/plugins/tracking-script-manager/templates/script-active-metabox.php on line 2
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/tracking-script-manager/templates/script-order-metabox.php on line 1
    • > PHP Notice
      Undefined variable: expiry_data in wp-content/plugins/tracking-script-manager/templates/script-expiry-metabox.php on line 3
    • > PHP Notice
      Undefined variable: location in wp-content/plugins/tracking-script-manager/templates/script-location-metabox.php on line 3
    • > PHP Notice
      Undefined variable: location in wp-content/plugins/tracking-script-manager/templates/script-location-metabox.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Background_Process' not found in wp-content/plugins/tracking-script-manager/classes/class-process-tracking-scripts.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Control Description), #2 (Using the "After " script location.), #3 (View your Tracking Scripts.), #4 (Add a new Tracking Script to a specific post or page (including custom post types).)
  • Tags: You are using too many tags: 18 tag instead of maximum 10
Please take inspiration from this readme.txt

tracking-script-manager/tracking-scripts-manager.php 92% from 13 tests

The main file in "Tracking Script Manager" v. 2.0.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tracking-script-manager.php" instead of "tracking-scripts-manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,741 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP102003621,106
SVG100414
JavaScript377141
CSS44180

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity33.25
▷ Minimum class complexity4.00
▷ Maximum class complexity95.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes250.00%
▷ Concrete classes250.00%
▷ Final classes00.00%
Methods68
▷ Static methods00.00%
▷ Public methods4363.24%
▷ Protected methods2232.35%
▷ Private methods34.41%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 1.00MB with 0.79MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) screenshot-1.png157.23KB0.00KB▼ 100.00%
screenshot-3.png265.09KB69.25KB▼ 73.88%
screenshot-2.png319.60KB95.68KB▼ 70.06%
screenshot-4.png281.75KB72.83KB▼ 74.15%