10% segment-for-wp-by-in8-io

Code Review | Segment For Wordpress

WordPress plugin Segment For Wordpress scored 10% from 54 tests.

About plugin

  • Plugin page: segment-for-wp-by...
  • Plugin version: 2.3.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8.2
  • WordPress version: 5.8.1
  • First release: Jun 12, 2019
  • Latest release: Dec 4, 2021
  • Number of updates: 29
  • Update frequency: every 31.2 days
  • Top authors: juanin8 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 1,656 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/segment-for-wp-by-in8-io/includes/class-segment-for-wp-by-in8-io.php+197
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.47MB] [CPU: ▼171.82ms] Passed 4 tests

Analyzing server-side resources used by Segment For Wordpress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.17 ▲0.3310.82 ▼11.08
Dashboard /wp-admin3.18 ▲0.1214.17 ▼22.48
Posts /wp-admin/edit.php3.19 ▲0.0711.14 ▼19.42
Add New Post /wp-admin/post-new.php3.19 ▼2.2611.18 ▼632.53
Media Library /wp-admin/upload.php3.19 ▲0.1810.38 ▼12.85
Segment for WP /wp-admin/options-general.php?page=segment-for-wp-by-in8-io3.1910.16
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.1912.24

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 728 new files
Database: 5 new tables, 4 new options
New tables
wp_actionscheduler_actions
wp_segment_4_wp
wp_actionscheduler_logs
wp_actionscheduler_claims
wp_actionscheduler_groups
New WordPress options
action_scheduler_hybrid_store_demarkation
action_scheduler_lock_async-request-runner
schema-ActionScheduler_LoggerSchema
schema-ActionScheduler_StoreSchema

Browser metrics Passed 4 tests

An overview of browser requirements for Segment For Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲20016.82 ▲0.788.53 ▲2.9876.42 ▼1.90
Dashboard /wp-admin2,941 ▲456.00 ▼0.14112.69 ▼30.98165.40 ▼18.33
Posts /wp-admin/edit.php2,749 ▲123.24 ▲0.0163.60 ▼0.91136.45 ▼9.59
Add New Post /wp-admin/post-new.php3,749 ▲4218.97 ▲0.19420.82 ▼9.98163.03 ▲5.40
Media Library /wp-admin/upload.php1,761 ▲125.50 ▼0.05140.79 ▼0.28187.29 ▲1.91
Segment for WP /wp-admin/options-general.php?page=segment-for-wp-by-in8-io2,1573.2573.38157.29
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,5802.5655.43111.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/segment-for-wp-by-in8-io/includes/class-segment-for-wp-by-in8-io.php+197
    Trying to access array offset on value of type bool
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • schema-ActionScheduler_StoreSchema
    • action_scheduler_lock_async-request-runner
    • schema-ActionScheduler_LoggerSchema
    • action_scheduler_hybrid_store_demarkation

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=action-scheduler
    • > Notice in wp-content/plugins/segment-for-wp-by-in8-io/includes/class-segment-for-wp-by-in8-io.php+197
    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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/segment-for-wp-by-in8-io/public/partials/segment-for-wp-by-in8-io-public-display.php
    • > /wp-content/plugins/segment-for-wp-by-in8-io/admin/partials/segment-for-wp-by-in8-io-admin-display.php
  • 85× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/tests/phpunit/jobstore/AbstractStoreTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/lib/cron-expression/CronExpression_HoursField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/classes/ActionScheduler_QueueRunner.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/segment_php/test/AnalyticsTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_ListTable' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/classes/ActionScheduler_ListTable.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/tests/phpunit/migration/Runner_Test.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/tests/phpunit/logging/ActionScheduler_DBLogger_Test.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/segment-for-wp-by-in8-io/includes/action-scheduler/tests/ActionScheduler_UnitTestCase.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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
3 plugin tags: segment, tracking, analytics

segment-for-wp-by-in8-io/segment-for-wp-by-in8-io.php Passed 13 tests

The main PHP script in "Segment For Wordpress" version 2.3.0 is automatically included on every request by WordPress
31 characters long description:
Segment Analytics for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected140,770 lines of code in 672 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4282,63313,30691,251
PHP1885,4197,64720,494
JSON60019,057
CSS151,2023005,417
SVG3002,917
Markdown1547301,080
XML5128151
Bourne Shell32615143
YAML5145111
HTML28070
Sass110047
make18032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.04
▷ Minimum class complexity1.00
▷ Maximum class complexity397.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces3
Interfaces3
Traits0
Classes172
▷ Abstract classes1911.05%
▷ Concrete classes15388.95%
▷ Final classes00.00%
Methods1,199
▷ Static methods14912.43%
▷ Public methods1,00383.65%
▷ Protected methods15813.18%
▷ Private methods383.17%
Functions45
▷ Named functions2248.89%
▷ Anonymous functions2351.11%
Constants36
▷ Global constants38.33%
▷ Class constants3391.67%
▷ Public constants33100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
23 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/exopite-simple-options/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/action-scheduler/docs/android-chrome-256x256.png2.93KB3.03KB0.00%
includes/action-scheduler/docs/favicon-32x32.png1.16KB0.71KB▼ 39.02%
admin/exopite-simple-options/assets/images/ui-icons_bf3030_256x240.png4.27KB4.11KB▼ 3.78%
admin/exopite-simple-options/assets/images/ui-bg_glass_25_e1f0f5_1x400.png0.11KB0.11KB0.00%