73% segmetrics

Code Review | SegMetrics Marketing Analytics

WordPress plugin SegMetrics Marketing Analytics scored73%from 54 tests.

About plugin

  • Plugin page: segmetrics
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9.0
  • WordPress version: 6.3.1
  • First release: Oct 8, 2019
  • Latest release: May 16, 2022
  • Number of updates: 10
  • Update frequency: every 95.0 days
  • Top authors: segmetrics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,361 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼10.68ms] Passed 4 tests

An overview of server-side resources used by SegMetrics Marketing Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.99 ▼1.94
Dashboard /wp-admin3.37 ▲0.0349.87 ▼13.07
Posts /wp-admin/edit.php3.49 ▲0.1348.14 ▼3.20
Add New Post /wp-admin/post-new.php5.95 ▲0.0786.20 ▼24.51
Media Library /wp-admin/upload.php3.30 ▲0.0736.13 ▲0.64
SegMetrics /wp-admin/options-general.php?page=segmetrics_settings3.2631.52

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for SegMetrics Marketing Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.10 ▼0.251.86 ▼0.0642.43 ▼0.73
Dashboard /wp-admin2,204 ▲305.56 ▼0.1191.78 ▼1.0539.86 ▼2.85
Posts /wp-admin/edit.php2,106 ▲62.01 ▲0.0435.42 ▼4.2132.85 ▼6.85
Add New Post /wp-admin/post-new.php1,533 ▲523.65 ▲0.52708.42 ▲47.8557.25 ▲0.25
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.08102.47 ▼4.2350.74 ▲0.74
SegMetrics /wp-admin/options-general.php?page=segmetrics_settings8651.9923.9842.71

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=segmetrics_settings
    • > Notice in wp-content/plugins/segmetrics/admin/class-segmetrics-admin.php+137
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/segmetrics/public/partials/segmetrics-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/segmetrics/public/partials/segmetrics-public-display.php on line 3
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/segmetrics/public/partials/segmetrics-public-display.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/segmetrics/admin/partials/segmetrics-admin-display.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: infusionsoft, segmetrics, ontraport, activecampaign, convertkit...

segmetrics/segmetrics.php Passed 13 tests

This is the main PHP file of "SegMetrics Marketing Analytics" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
103 characters long description:
Instantly include the SegMetrics tracking script to get unparalleled insights into your visitor journey

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
Everything looks great! No dangerous files found in this plugin435 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP13157559345
CSS1171387
JavaScript12273

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2882.35%
▷ Protected methods00.00%
▷ Private methods617.65%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
admin/img/icon.png3.16KB1.91KB▼ 39.70%
admin/img/logo.png5.21KB2.41KB▼ 53.75%