78% modal-dialog

Code Review | Modal Dialog

WordPress plugin Modal Dialog scored78%from 54 tests.

About plugin

  • Plugin page: modal-dialog
  • Plugin version: 3.5.15
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.2
  • WordPress version: 6.3.1
  • First release: Apr 8, 2010
  • Latest release: Apr 21, 2023
  • Number of updates: 154
  • Update frequency: every 30.9 days
  • Top authors: jackdewey (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /144,569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼5.05ms] Passed 4 tests

Analyzing server-side resources used by Modal Dialog
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.45 ▲3.15
Dashboard /wp-admin3.58 ▲0.2345.82 ▼14.08
Posts /wp-admin/edit.php3.69 ▲0.3346.45 ▼1.91
Add New Post /wp-admin/post-new.php6.18 ▲0.3082.28 ▼7.35
Media Library /wp-admin/upload.php3.50 ▲0.2740.71 ▲6.49
Configurations /wp-admin/admin.php?page=modal-dialog-configurations3.4630.63
Modal Dialog /wp-admin/admin.php?page=modal-dialog3.4631.22
FAQ /wp-admin/admin.php?page=modal-dialog-faq3.4630.23

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 46 new files
Database: no new tables, 8 new options
New WordPress options
MD_General
MD_PP1
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Modal Dialog
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲22013.85 ▼0.6811.58 ▲9.7943.08 ▲1.38
Dashboard /wp-admin2,233 ▲525.59 ▼0.1579.16 ▼19.8771.74 ▲31.92
Posts /wp-admin/edit.php2,138 ▲352.00 ▲0.0434.77 ▼7.6432.88 ▼5.73
Add New Post /wp-admin/post-new.php6,457 ▲4,93127.23 ▲3.67952.86 ▲269.4562.24 ▲2.55
Media Library /wp-admin/upload.php1,435 ▲354.15 ▲0.0196.58 ▼3.2970.07 ▲28.31
Configurations /wp-admin/admin.php?page=modal-dialog-configurations1,7492.3940.2631.89
Modal Dialog /wp-admin/admin.php?page=modal-dialog1,0942.2235.3429.71
FAQ /wp-admin/admin.php?page=modal-dialog-faq1,0282.0736.3032.92

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • MD_General
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • MD_PP1
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=modal-dialog-faq
    • > Notice in wp-content/plugins/modal-dialog/modal-dialog-admin.php+333
    Undefined property: modal_dialog_plugin_admin::$pagehook

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/template.php): failed to open stream: No such file or directory in wp-content/plugins/modal-dialog/modal-dialog.php on line 28
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/modal-dialog/modal-dialog.php on line 28
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/modal-dialog/modal-dialog.php on line 28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: dialog, window, modal, multiple, pop-up

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

The principal PHP file in "Modal Dialog" v. 3.5.15 is loaded by WordPress automatically on each request
109 characters long description:
A plugin used to display a modal dialog to visitors with text content or the contents of an external web site

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,834 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP3284471,623
JavaScript6298105873
CSS25634338

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 142)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity148.00
▷ Minimum class complexity85.00
▷ Maximum class complexity211.00
Average method complexity10.48
▷ Minimum method complexity1.00
▷ Maximum method complexity142.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
31 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fancybox/fancy_shadow_s.png0.11KB0.19KB0.00%
fancybox/fancy_title_main.png0.09KB0.14KB0.00%
fancybox/fancy_nav_right.png1.42KB1.66KB0.00%
fancybox/fancy_closebox.png1.87KB1.74KB▼ 6.60%
colorbox/images/controls.png2.83KB1.28KB▼ 54.82%