84% optimizely-x

Code Review | Optimizely X

WordPress plugin Optimizely X scored 84% from 54 tests.

About plugin

  • Plugin page: optimizely-x
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 5.8.1
  • First release: Aug 15, 2017
  • Latest release: Jul 3, 2020
  • Number of updates: 14
  • Update frequency: every 75.2 days
  • Top authors: lswartsenburg (71.43%)evansamy (21.43%)jaredcobb (21.43%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,902 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.34MB] [CPU: ▼144.42ms] Passed 4 tests

A check of server-side resources used by Optimizely X
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.11 ▲0.3935.51 ▲9.01
Dashboard /wp-admin3.43 ▲0.3849.36 ▲4.63
Posts /wp-admin/edit.php3.48 ▲0.3736.92 ▼17.80
Add New Post /wp-admin/post-new.php5.73 ▲0.3088.38 ▼560.53
Media Library /wp-admin/upload.php3.31 ▲0.3134.93 ▼3.97
Optimizely /wp-admin/admin.php?page=optimizely-config3.2936.15
Results /wp-admin/admin.php?page=optimizely-results3.3230.69

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 3 new options
New WordPress options
optimizely_post_types
optimizely_x_post_types
optimizely_x_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Optimizely X
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲12015.75 ▼0.1511.56 ▲0.9150.58 ▼0.17
Dashboard /wp-admin3,018 ▲876.08 ▲0.12143.87 ▼1.69130.67 ▲19.96
Posts /wp-admin/edit.php2,811 ▲722.71 ▼0.0062.94 ▼5.6886.37 ▼3.79
Add New Post /wp-admin/post-new.php1,573 ▼11018.43 ▲0.07393.93 ▲3.82118.50 ▲8.31
Media Library /wp-admin/upload.php1,806 ▼45.00 ▼0.01153.20 ▼11.16135.27 ▲14.93
Optimizely /wp-admin/admin.php?page=optimizely-config1,5342.4274.7386.05
Results /wp-admin/admin.php?page=optimizely-results1,1072.1368.9374.44

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 3 options in the database
    • optimizely_x_version
    • optimizely_post_types
    • optimizely_x_post_types

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 29× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/optimizely-x/admin/partials/fields/optimizely-x-conditional-activation-code.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/optimizely-x/admin/partials/notices/no-token.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/optimizely-x/admin/partials/fields/optimizely-x-num-variations.php:10
    • > PHP Fatal error
      Trait 'Optimizely_X\\Singleton' not found in wp-content/plugins/optimizely-x/includes/class-admin.php on line 16
    • > PHP Fatal error
      Trait 'Optimizely_X\\Singleton' not found in wp-content/plugins/optimizely-x/includes/class-i18n.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'Optimizely_X\\AJAX' not found in wp-content/plugins/optimizely-x/includes/class-ajax-metabox.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Optimizely_X\\AJAX' not found in wp-content/plugins/optimizely-x/includes/class-ajax-config.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/optimizely-x/admin/partials/metabox/unpublished.php:11
    • > PHP Fatal error
      Trait 'Optimizely_X\\Singleton' not found in wp-content/plugins/optimizely-x/includes/class-core.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/optimizely-x/admin/partials/config.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

optimizely-x/optimizely-x.php 92% from 13 tests

The main PHP file in "Optimizely X" ver. 1.2.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 711 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,411 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP344401,2201,963
JavaScript484136366
CSS1272582

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.64
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods77
▷ Static methods56.49%
▷ Public methods4963.64%
▷ Protected methods1114.29%
▷ Private methods1722.08%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants228.57%
▷ Class constants571.43%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/optimizely-icon.png1.47KB0.89KB▼ 39.46%