84% wp-content-experiments-event-tracking

Code Review | WP Content Experiments & Event Tracking

WordPress plugin WP Content Experiments & Event Tracking scored 84% from 54 tests.

About plugin

  • Plugin page: wp-content-experi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-3.4.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2012
  • Latest release: Oct 6, 2012
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: wpsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 3,667 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
Installer ran successfully

Server metrics [RAM: ▼0.65MB] [CPU: ▼19.09ms] Passed 4 tests

This is a short check of server-side resources used by WP Content Experiments & Event Tracking
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.15 ▼8.20
Dashboard /wp-admin3.33 ▲0.0346.59 ▼3.82
Posts /wp-admin/edit.php3.38 ▲0.0246.66 ▼2.48
Add New Post /wp-admin/post-new.php3.22 ▼2.6737.42 ▼61.85
Media Library /wp-admin/upload.php3.25 ▲0.0237.78 ▲2.28

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

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

Browser metrics Passed 4 tests

WP Content Experiments & Event Tracking: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲5013.68 ▼0.721.57 ▼0.4340.65 ▼4.47
Dashboard /wp-admin2,210 ▲345.85 ▲0.7998.84 ▼19.1238.91 ▼10.67
Posts /wp-admin/edit.php2,095 ▲62.01 ▼0.0333.94 ▼0.9738.80 ▲4.08
Add New Post /wp-admin/post-new.php1,816 ▲28322.85 ▼0.06637.29 ▼57.6473.17 ▲8.57
Media Library /wp-admin/upload.php1,398 ▲134.16 ▼0.05110.56 ▲10.5950.70 ▲4.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-content-experiments-event-tracking/wp-content-experiments.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: google analytics, event tracking, google content experiments, ab testing, split testing

wp-content-experiments-event-tracking/wp-content-experiments.php 92% from 13 tests

This is the main PHP file of "WP Content Experiments & Event Tracking" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-content-experiments-event-tracking.php" instead of "wp-content-experiments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin342 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP45567333
JavaScript1109

PHP code Passed 2 tests

This is a short overview 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.32
Average class complexity12.33
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.41MB with 0.23MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png256.74KB106.43KB▼ 58.54%
screeenshot-2.png160.14KB70.52KB▼ 55.96%