66% simplemodal

Code Review | Simple Modal

WordPress plugin Simple Modal scored 66% from 54 tests.

About plugin

  • Plugin page: simplemodal
  • Plugin version: 0.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2014
  • Latest release: Aug 26, 2014
  • Number of updates: 10
  • Update frequency: every 8.1 days
  • Top authors: arsdehnel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 2,491 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.69ms] Passed 4 tests

Analyzing server-side resources used by Simple Modal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1455.00 ▲10.93
Dashboard /wp-admin3.44 ▲0.1358.62 ▲4.64
Posts /wp-admin/edit.php3.54 ▲0.1858.70 ▲5.13
Add New Post /wp-admin/post-new.php6.02 ▲0.13100.42 ▼35.44
Media Library /wp-admin/upload.php3.36 ▲0.1349.93 ▲11.86
Add New /wp-admin/post-new.php?post_type=simplemodal3.4752.53
Modals /wp-admin/edit.php?post_type=simplemodal3.3949.91
Simple Modal /wp-admin/options-general.php?page=simplemodal--settings3.3046.78

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Simple Modal: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲5013.59 ▼0.762.35 ▲0.4042.44 ▼4.14
Dashboard /wp-admin2,237 ▲285.79 ▼0.09104.63 ▼6.1540.56 ▼6.66
Posts /wp-admin/edit.php2,123 ▲371.99 ▼0.0238.34 ▲2.4935.97 ▲1.82
Add New Post /wp-admin/post-new.php1,542 ▲917.58 ▼5.53700.73 ▲20.9855.86 ▼6.20
Media Library /wp-admin/upload.php1,419 ▲344.25 ▲0.0395.66 ▼7.8542.76 ▲1.35
Add New /wp-admin/post-new.php?post_type=simplemodal2,2517.61197.6165.84
Modals /wp-admin/edit.php?post_type=simplemodal1,0842.0233.8827.92
Simple Modal /wp-admin/options-general.php?page=simplemodal--settings9042.0629.6927.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=simplemodal
    • > Notice in wp-content/plugins/simplemodal/classes/ui.php+39
    Undefined variable: option_str
    • > GET request to /wp-admin/post-new.php?post_type=simplemodal
    • > Notice in wp-content/plugins/simplemodal/classes/ui.php+46
    Undefined property: SimpleModalUI::$class
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simplemodal--settings
    • > Notice in wp-content/plugins/simplemodal/classes/ui.php+68
    Undefined variable: field_class

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/simplemodal/views/public-page-html.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simplemodal/views/settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function display() on null in wp-content/plugins/simplemodal/tinymce/modal-list.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/simplemodal/views/simplemodal_post_type/meta_box.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/simplemodal/functions.php:9
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/simplemodal/views/settings.php on line 4
    • > PHP Notice
      Undefined variable: modals in wp-content/plugins/simplemodal/tinymce/modal-list.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simplemodal/views/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplemodal/simple-modal.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simplemodal--settings
    • > Network (severe)
    wp-content/plugins/simple-modal/css/admin-general.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === simplemodal === )
The official readme.txt is a good inspiration

simplemodal/simple-modal.php 92% from 13 tests

The main PHP file in "Simple Modal" ver. 0.3.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simplemodal.php" instead of "simple-modal.php")

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
There were no executable files found in this plugin723 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112974435
CSS335183
JavaScript2221105

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity4.17
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2068.97%
▷ Protected methods00.00%
▷ Private methods931.03%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tinymce/icon.png3.77KB0.75KB▼ 80.19%
icon-wp-admin-menu.png3.77KB0.75KB▼ 80.19%