67% experience-manager

Code Review | Experience Manager

WordPress plugin Experience Manager scored67%from 54 tests.

About plugin

  • Plugin page: experience-manager
  • Plugin version: 4.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-5.4
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Jun 23, 2020
  • Number of updates: 47
  • Update frequency: every 8.3 days
  • Top authors: thmarx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /793 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.06MB] [CPU: ▼31.38ms] Passed 4 tests

Analyzing server-side resources used by Experience Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1030.74 ▼12.54
Dashboard /wp-admin4.08 ▲0.7339.51 ▼27.66
Posts /wp-admin/edit.php4.13 ▲0.7742.94 ▼13.87
Add New Post /wp-admin/post-new.php4.04 ▼1.8543.29 ▼71.46
Media Library /wp-admin/upload.php4.05 ▲0.8237.11 ▲2.39
Settings /wp-admin/admin.php?page=tma-webtools-setting-admin4.0442.56
Add New /wp-admin/post-new.php?post_type=exm_content4.1342.95
All Flex Contents /wp-admin/edit.php?post_type=exm_content4.1140.39
All Target Segments /wp-admin/edit.php?post_type=tma_segment4.1142.39
Dashboard /wp-admin/admin.php?page=experience-manager/pages/tma-webtools-admin.php4.0436.27
Add New /wp-admin/post-new.php?post_type=tma_segment4.1245.94

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 240 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
category_children
db_upgraded
tma-webtools-Integrations
tma_webtools_option
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Experience Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,169 ▲40815.27 ▲0.556.62 ▲4.9043.67 ▼0.35
Dashboard /wp-admin2,427 ▲2506.46 ▲0.79125.91 ▲29.4390.52 ▲49.38
Posts /wp-admin/edit.php2,373 ▲2733.59 ▲1.6256.16 ▲17.1487.33 ▲48.78
Add New Post /wp-admin/post-new.php1,621 ▲9523.10 ▼0.17665.66 ▼6.4835.72 ▼25.32
Media Library /wp-admin/upload.php1,507 ▲1104.32 ▲0.1389.00 ▼12.7596.05 ▲50.45
Settings /wp-admin/admin.php?page=tma-webtools-setting-admin1,3323.5352.8161.94
Add New /wp-admin/post-new.php?post_type=exm_content2,8415.92141.24159.53
All Flex Contents /wp-admin/edit.php?post_type=exm_content1,3343.5052.7972.54
All Target Segments /wp-admin/edit.php?post_type=tma_segment1,6053.5951.9577.93
Dashboard /wp-admin/admin.php?page=experience-manager/pages/tma-webtools-admin.php1,0573.2643.9963.14
Add New /wp-admin/post-new.php?post_type=tma_segment2,7295.1094.44138.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • tma-webtools-Integrations
    • db_upgraded
    • category_children
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tma_segment
    • > Notice in wp-content/plugins/experience-manager/includes/tma_functions.php+55
    Undefined property: stdClass::$status

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/experience-manager/includes/backend/content/content-library.php
    • > /wp-content/plugins/experience-manager/includes/backend/banner.php
    • > /wp-content/plugins/experience-manager/includes/backend/segment/class.segment-editor-help-wizard.php
    • > /wp-content/plugins/experience-manager/includes/backend/content/preview-box.php
    • > /wp-content/plugins/experience-manager/includes/backend/content/settings-box.php
    • > /wp-content/plugins/experience-manager/includes/backend/content/editor-box.php
  • 46× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant TMA_EXPERIENCE_MANAGER_SEGMENT_MATCHING_ALL - assumed 'TMA_EXPERIENCE_MANAGER_SEGMENT_MATCHING_ALL' (this will throw an Error in a future version of PHP) in wp-content/plugins/experience-manager/includes/frontend/class.shortcode_tma_content.php on line 190
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/experience-manager/dependencies/Mustache/Exception/LogicException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'TMA\\ExperienceManager\\Events\\Base' not found in wp-content/plugins/experience-manager/includes/modules/events/class.edd_tracker.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/experience-manager/dependencies/Mustache/Loader/InlineLoader.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'TMA\\ExperienceManager\\Integration' not found in wp-content/plugins/experience-manager/includes/modules/editors/beaver/class.beaverbuilder_integration.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'TMA\\ExperienceManager\\Base' not found in wp-content/plugins/experience-manager/includes/modules/messages/elementor/class.elementor-popup.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Source' not found in wp-content/plugins/experience-manager/dependencies/Mustache/Source/FilesystemSource.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TMA\\ExperienceManager\\Integration' not found in wp-content/plugins/experience-manager/includes/frontend/template_tags.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TMA\\ExperienceManager\\Plugins' not found in wp-content/plugins/experience-manager/includes/modules/events/class.ecommerce_events.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Loader_FilesystemLoader' not found in wp-content/plugins/experience-manager/dependencies/Mustache/Loader/ProductionFilesystemLoader.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=exm_content
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=exm_content 532:36 Uncaught SyntaxError: Unexpected token ';'
    • > GET request to /wp-admin/post-new.php?post_type=exm_content
    • > Javascript (severe) in unknown
    /wp-content/plugins/experience-manager/assets/content-editor/content-library.js?ver=1 17:6 Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')
    • > GET request to /wp-admin/edit.php?post_type=tma_segment
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).checkbox is not a function" "TypeError: jQuery(...).checkbox is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=tma_segment:421:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=tma_segment
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).checkbox is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: experience manager, popup, personalization, targeting, product targeting...

experience-manager/experience-manager.php 92% from 13 tests

The primary PHP file in "Experience Manager" version 4.4.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected24,935 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript611,4031,21011,351
PHP1031,7913,4977,897
SVG70122,909
HTML924911,279
CSS12964761,173
LESS12526223
PO File14053103

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.82
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces8
Interfaces6
Traits0
Classes78
▷ Abstract classes67.69%
▷ Concrete classes7292.31%
▷ Final classes56.94%
Methods531
▷ Static methods438.10%
▷ Public methods40576.27%
▷ Protected methods499.23%
▷ Private methods7714.50%
Functions52
▷ Named functions3567.31%
▷ Anonymous functions1732.69%
Constants74
▷ Global constants912.16%
▷ Class constants6587.84%
▷ Public constants65100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flex-content_16.png0.72KB0.53KB▼ 25.68%
assets/semantic/themes/default/assets/images/flags.png27.46KB29.21KB0.00%
images/settings.png0.71KB0.51KB▼ 28.25%
images/settings_16.png0.70KB0.65KB▼ 6.60%
images/tma_content.png0.43KB0.47KB0.00%