62% optimizely-project-snippet-embedder

Code Review | Optimizely Snippet Embedder

WordPress plugin Optimizely Snippet Embedder scored62%from 54 tests.

About plugin

  • Plugin page: optimizely-projec...
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1.2
  • WordPress version: 6.3.1
  • First release: Mar 11, 2015
  • Latest release: Apr 21, 2015
  • Number of updates: 14
  • Update frequency: every 2.9 days
  • Top authors: michaelkjeldsen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,029 total downloads

Benchmarks

Plugin footprint 65% 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.94MB] [CPU: ▼42.46ms] Passed 4 tests

An overview of server-side resources used by Optimizely Snippet Embedder
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0239.51 ▲0.52
Dashboard /wp-admin3.05 ▼0.3322.80 ▼46.13
Posts /wp-admin/edit.php3.05 ▼0.3430.29 ▼23.15
Add New Post /wp-admin/post-new.php3.05 ▼2.8724.16 ▼87.26
Media Library /wp-admin/upload.php3.05 ▼0.2227.46 ▼13.31
Optimizely Snippet Embedder /wp-admin/tools.php?page=mchl-optimizely-snippet-embedder3.0624.00

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
mchl_optimizely_data
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Optimizely Snippet Embedder
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4114.34 ▲0.051.75 ▼0.0143.46 ▲6.40
Dashboard /wp-admin2,205 ▲255.54 ▼0.1480.24 ▼7.8941.25 ▲1.10
Posts /wp-admin/edit.php2,111 ▲81.98 ▼0.0439.27 ▼0.4034.46 ▼3.47
Add New Post /wp-admin/post-new.php1,538 ▲1223.09 ▲0.06666.53 ▼18.7561.31 ▲0.69
Media Library /wp-admin/upload.php1,416 ▲134.21 ▲0.08103.46 ▼7.9646.33 ▼2.20
Optimizely Snippet Embedder /wp-admin/tools.php?page=mchl-optimizely-snippet-embedder8422.0324.2634.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=mchl-optimizely-snippet-embedder
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% 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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/optimizely-project-snippet-embedder/index.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/optimizely-project-snippet-embedder/mchl-optimizely-snippet-embedder.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: website optimization, splittest, split testing, mvt test, optimizely...

optimizely-project-snippet-embedder/mchl-optimizely-snippet-embedder.php 85% from 13 tests

This is the main PHP file of "Optimizely Snippet Embedder" version 1.1.6, 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:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("optimizely-project-snippet-embedder.php" instead of "mchl-optimizely-snippet-embedder.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 plugin114 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22027114

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin