70% optinmonster

Code Review | Popup Builder by OptinMonster - WordPress Popups for Optins, Email Newsletters and Lead Generation

WordPress plugin Popup Builder by OptinMonster - WordPress Popups for Optins, Email Newsletters and Lead Generation scored70%from 54 tests.

About plugin

  • Plugin page: optinmonster
  • Plugin version: 2.15.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.4
  • WordPress version: 6.3.1
  • First release: Apr 26, 2015
  • Latest release: Nov 15, 2023
  • Number of updates: 340
  • Update frequency: every 9.2 days
  • Top authors: jtsternberg (36.47%)griffinjt (28.53%)thebrandonallen (16.47%)channeleaton (9.12%)dvinson (4.12%)

Code review

54 tests

User reviews

710 reviews

Install metrics

1,000,000+ active /95,956,693 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▲5.20ms] Passed 4 tests

Server-side resources used by Popup Builder by OptinMonster - WordPress Popups for Optins, Email Newsletters and Lead Generation
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1240.28 ▲0.08
Dashboard /wp-admin3.61 ▲0.3151.95 ▲3.30
Posts /wp-admin/edit.php3.67 ▲0.3154.82 ▲5.93
Add New Post /wp-admin/post-new.php6.30 ▲0.41677.06 ▲589.73
Media Library /wp-admin/upload.php3.47 ▲0.2543.20 ▲11.50
Integrations /wp-admin/admin.php?page=optin-monster-integrations3.5138.84
Campaigns /wp-admin/admin.php?page=optin-monster-campaigns3.4840.12
OptinMonster /wp-admin/admin.php?page=optin-monster-api-settings3.3329.14
University /wp-admin/admin.php?page=optin-monster-university3.4837.11
Subscribers /wp-admin/admin.php?page=optin-monster-monsterleads3.4837.04
Dashboard /wp-admin/admin.php?page=optin-monster-dashboard3.4836.30
Onboarding Wizard /wp-admin/admin.php?page=optin-monster-onboarding-wizard3.4834.11
Personalization /wp-admin/admin.php?page=optin-monster-personalization3.4838.05
Playbooks /wp-admin/admin.php?page=optin-monster-playbooks3.4836.32
Templates /wp-admin/admin.php?page=optin-monster-templates3.4837.73

Server storage [IO: ▲37.21MB] [DB: ▲0.13MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 37.21MB)
Filesystem: 379 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
optin_monster_api
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
omapi_review
optinmonster_upgrade_completed
db_upgraded
widget_optin-monster-api

Browser metrics Passed 4 tests

A check of browser resources used by Popup Builder by OptinMonster - WordPress Popups for Optins, Email Newsletters and Lead Generation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20114.77 ▲0.491.81 ▼0.0341.56 ▼4.33
Dashboard /wp-admin2,368 ▲1885.77 ▲0.1397.63 ▲3.7487.29 ▲43.56
Posts /wp-admin/edit.php2,252 ▲1492.17 ▲0.2043.24 ▲5.8142.27 ▲7.70
Add New Post /wp-admin/post-new.php1,870 ▲34427.10 ▲3.56780.43 ▲69.2842.75 ▼12.48
Media Library /wp-admin/upload.php1,549 ▲1464.34 ▲0.16102.22 ▲3.5248.33 ▲3.07
Integrations /wp-admin/admin.php?page=optin-monster-integrations2,68018.96321.7369.13
Campaigns /wp-admin/admin.php?page=optin-monster-campaigns1,2779.86300.0046.66
OptinMonster /wp-admin/admin.php?page=optin-monster-api-settings1,81010.57135.3363.22
University /wp-admin/admin.php?page=optin-monster-university1,42310.34130.7848.60
Subscribers /wp-admin/admin.php?page=optin-monster-monsterleads1,2719.71127.9843.67
Dashboard /wp-admin/admin.php?page=optin-monster-dashboard1,81010.55127.9651.50
Onboarding Wizard /wp-admin/admin.php?page=optin-monster-onboarding-wizard1,2599.72137.1064.42
Personalization /wp-admin/admin.php?page=optin-monster-personalization1,35610.11128.5245.74
Playbooks /wp-admin/admin.php?page=optin-monster-playbooks2,92914.64141.9490.51
Templates /wp-admin/admin.php?page=optin-monster-templates10,40633.25150.1767.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • optinmonster_upgrade_completed
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • omapi_review
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_optin-monster-api
    • widget_theysaidso_widget

Smoke tests 25% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/optinmonster/views/upgrade-link-css.php
    • > /wp-content/plugins/optinmonster/views/jiggle-css.php
    • > /wp-content/plugins/optinmonster/views/woocommerce-marketing-card-css.php
    • > /wp-content/plugins/optinmonster/views/shortcode-modal-css.php
    • > /wp-content/plugins/optinmonster/views/archie-loading.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/optinmonster/views/plugin-banner.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/optinmonster/views/seedprod-settings-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/optinmonster/views/monsterlink-campaign-shortcode-modal.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Button' not found in wp-content/plugins/optinmonster/OMAPI/Elementor/ButtonWidget.php:20
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/optinmonster/views/trustpulse-settings-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/optinmonster/views/product-metabox.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/optinmonster/views/inline-campaign-shortcode-modal.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/optinmonster/views/install-plugin-form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/optinmonster/views/coupon-metabox.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/optinmonster/views/woocommerce-marketing-card.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=optin-monster-playbooks
    • > Network (severe)
    https://api.omwpapi.com/v2/embed/130236?d=wp.com - Failed to load resource: the server responded with a status of 401 ()
    • > GET request to /wp-admin/admin.php?page=optin-monster-playbooks
    • > Console-api (severe) in unknown
    https://a.omwpapi.com/app/js/api.min.js 0:24793 "[OptinMonster]" "This account is not currently active. It is either expired, paused, archived, cancelled or temporarily suspended."

Optimizations

Plugin configuration 73% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Select a Campaign type (popup, full screen, floating bar, slide-in, inline or Gamified)) image required
You can take inspiration from this readme.txt

optinmonster/optin-monster-wp-api.php 54% from 13 tests

The primary PHP file in "Popup Builder by OptinMonster - WordPress Popups for Optins, Email Newsletters and Lead Generation" version 2.15.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("optinmonster.php" instead of "optin-monster-wp-api.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7.0" instead of "3.2")
  • Description: The description should be shorter than 140 characters (currently 175 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin14,948 lines of code in 275 files:
LanguageFilesBlank linesComment linesLines of code
PHP912,7688,45810,880
SVG90122,019
JavaScript672108901,244
Markdown11660631
JSON200150
CSS240324

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.38
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes72
▷ Abstract classes45.56%
▷ Concrete classes6894.44%
▷ Final classes00.00%
Methods652
▷ Static methods11517.64%
▷ Public methods59491.10%
▷ Protected methods548.28%
▷ Private methods40.61%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants24
▷ Global constants1145.83%
▷ Class constants1354.17%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
45 compressed PNG files occupy 4.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/om-step-3-sm.png13.79KB12.35KB▼ 10.44%
assets/css/images/om-step-1-sm.png17.33KB16.40KB▼ 5.32%
assets/css/images/gravity-forms.png35.69KB20.37KB▼ 42.92%
vue/dist/img/measuring.b5e3f58e.png17.81KB18.13KB0.00%
assets/css/images/logo-formidable.png3.80KB4.23KB0.00%