83% popup-modal

Code Review | Popup Modal

WordPress plugin Popup Modal scored 83% from 54 tests.

About plugin

  • Plugin page: popup-modal
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6.1
  • WordPress version: 5.9.2
  • First release: Apr 12, 2016
  • Latest release: Feb 4, 2021
  • Number of updates: 55
  • Update frequency: every 32.0 days
  • Top authors: teckel (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 4,791 total downloads

Benchmarks

Plugin footprint Passed 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.09MB] [CPU: ▼326.73ms] Passed 4 tests

An overview of server-side resources used by Popup Modal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1259.58 ▲7.36
Dashboard /wp-admin3.53 ▲0.1257.06 ▲24.18
Posts /wp-admin/edit.php3.75 ▲0.1238.79 ▼27.91
Add New Post /wp-admin/post-new.php6.99 ▲0.0295.04 ▼1,288.02
Media Library /wp-admin/upload.php3.41 ▲0.1130.44 ▲1.67
All Popups /wp-admin/edit.php?post_type=popup_modal3.4532.72
Add New /wp-admin/post-new.php?post_type=popup_modal3.3548.55

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Popup Modal
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,794 ▲4016.20 ▲0.576.19 ▼1.301.98 ▼0.61
Dashboard /wp-admin2,919 ▲616.11 ▲0.01127.48 ▼5.66304.43 ▲140.03
Posts /wp-admin/edit.php2,719 ▲283.24 ▲0.0196.48 ▲31.79152.32 ▲4.49
Add New Post /wp-admin/post-new.php1,720 ▲3021.01 ▲0.14478.93 ▲16.80161.71 ▼13.98
Media Library /wp-admin/upload.php1,725 ▲335.54 ▲0.03144.15 ▼20.06188.14 ▼17.49
All Popups /wp-admin/edit.php?post_type=popup_modal1,4613.1760.58118.09
Add New /wp-admin/post-new.php?post_type=popup_modal3,76110.29215.23216.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+224
    Undefined index: popup_disable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+255
    Undefined index: popup_freq
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+226
    Undefined index: popup_expires
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+227
    Undefined index: popup_pages
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+228
    Undefined index: popup_click
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+229
    Undefined index: popup_location
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+230
    Undefined index: popup_width
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+231
    Undefined index: popup_title
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+232
    Undefined index: popup_color
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+233
    Undefined index: popup_bgcolor
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+234
    Undefined index: popup_buttons
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+255
    Trying to access array offset on value of type null
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+329
    Undefined variable: popup_freq
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+345
    Undefined variable: popup_pages
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+354
    Undefined variable: popup_click
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+364
    Undefined variable: popup_location
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+379
    Undefined variable: popup_title
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Notice in wp-content/plugins/popup-modal/popup-modal.php+402
    Undefined variable: popup_buttons

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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/popup-modal/template.php

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 fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=popup_modal
    • > Network (severe)
    wp-content/plugins/popup-modal/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 30 tag instead of maximum 10
You can take inspiration from this readme.txt

popup-modal/popup-modal.php Passed 13 tests

The main file in "Popup Modal" v. 2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
118 characters long description:
Easily create responsive WYSIWYG modals that popup at your desired frequency and optionally print with a single click.

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
Success! There were no dangerous files found in this plugin1,119 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS27669572
PHP22936382
JavaScript134165

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity101.00
▷ Minimum class complexity101.00
▷ Maximum class complexity101.00
Average method complexity12.11
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants15
▷ Global constants320.00%
▷ Class constants1280.00%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin