79% easy-modal

Code Review | Easy Modal

WordPress plugin Easy Modal scored 79% from 54 tests.

About plugin

  • Plugin page: easy-modal
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-4.7.3
  • WordPress version: 5.8.1
  • First release: May 29, 2011
  • Latest release: Apr 13, 2017
  • Number of updates: 189
  • Update frequency: every 11.4 days
  • Top authors: danieliser (98.41%)waltmesser (2.12%)

Code review

54 tests

User reviews

124 reviews

Install metrics

20,000+ active / 232,084 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.94MB] [CPU: ▼132.00ms] Passed 4 tests

Analyzing server-side resources used by Easy Modal
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.17 ▲0.4643.36 ▲20.79
Dashboard /wp-admin4.21 ▲1.1552.18 ▲9.70
Posts /wp-admin/edit.php4.26 ▲1.1551.64 ▲8.95
Add New Post /wp-admin/post-new.php6.51 ▲1.07107.85 ▼546.99
Media Library /wp-admin/upload.php4.09 ▲1.0930.69 ▲0.36
Add Ons /wp-admin/admin.php?page=easy-modal-addons4.0633.28
Theme /wp-admin/admin.php?page=easy-modal-themes4.1042.99
Help /wp-admin/admin.php?page=easy-modal-help4.0738.07
Settings /wp-admin/admin.php?page=easy-modal-settings4.0736.71
Modals /wp-admin/admin.php?page=easy-modal4.0837.65

Server storage [IO: ▲0.53MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 85 new files
Database: 4 new tables, no new options
New tables
wp_em_modal_metas
wp_em_modals
wp_em_theme_metas
wp_em_themes

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Modal
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,976 ▲38016.63 ▲1.1112.90 ▲3.1145.88 ▼4.68
Dashboard /wp-admin3,095 ▲1615.91 ▼0.02136.30 ▼7.29132.74 ▲17.15
Posts /wp-admin/edit.php2,885 ▲1462.82 ▲0.1365.96 ▲2.7490.45 ▲6.33
Add New Post /wp-admin/post-new.php1,982 ▲48219.07 ▲0.48376.96 ▲10.34114.16 ▲6.76
Media Library /wp-admin/upload.php1,877 ▲675.02 ▼0.02132.90 ▼21.68138.57 ▲18.08
Add Ons /wp-admin/admin.php?page=easy-modal-addons1,2865.24119.7068.56
Theme /wp-admin/admin.php?page=easy-modal-themes6,3779.09290.62145.24
Help /wp-admin/admin.php?page=easy-modal-help1,7458.37170.22136.65
Settings /wp-admin/admin.php?page=easy-modal-settings1,8568.15170.5796.95
Modals /wp-admin/admin.php?page=easy-modal1,8688.94181.64132.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 4 tables
    • wp_em_modals
    • wp_em_themes
    • wp_em_theme_metas
    • wp_em_modal_metas

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 43× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'EModal_Model' not found in wp-content/plugins/easy-modal/classes/model/modal/meta.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'EModal_Model' not found in wp-content/plugins/easy-modal/classes/model/modal.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-modal/classes/admin.php:261
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-modal/includes/admin/content.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-modal/includes/admin/help-general-tab.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-modal/includes/admin/settings-form-licenses-tab.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-modal/includes/admin/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/easy-modal/easy-modal.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-modal/includes/admin/modal-form-example-tab.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'EModal_Model' not found in wp-content/plugins/easy-modal/classes/model/theme/meta.php:1

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 browser errors
    • > GET request to /wp-admin/admin.php?page=easy-modal-themes
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&size=tall&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Feasy-modal.com%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1637236399449&_gfid=I0_1637236399449&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=27473723 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=easy-modal-help
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&size=tall&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Feasy-modal.com%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1637236405787&_gfid=I0_1637236405787&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=35221670 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=easy-modal-settings
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&size=tall&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Feasy-modal.com%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1637236407804&_gfid=I0_1637236407804&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=27410452 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=easy-modal
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&size=tall&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Feasy-modal.com%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1637236409810&_gfid=I0_1637236409810&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=36590445 - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: lightbox, modal, popup box, popup form, popup...

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

The main file in "Easy Modal" v. 2.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
135 characters long description:
Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.

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
Good job! No executable or dangerous file extensions detected8,752 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP575767525,729
JavaScript692701,396
PO File35768881,213
CSS3322414

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.95
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes42
▷ Abstract classes00.00%
▷ Concrete classes42100.00%
▷ Final classes00.00%
Methods223
▷ Static methods3817.04%
▷ Public methods20993.72%
▷ Protected methods73.14%
▷ Private methods73.14%
Functions120
▷ Named functions120100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin/sidebar-forum-support.png1.63KB0.91KB▼ 44.18%
assets/images/admin/sidebar-pro-support.png2.06KB1.23KB▼ 40.61%
assets/images/admin/easy-modal-icon.png0.51KB0.43KB▼ 16.00%
assets/images/admin/get-started-arrow.png0.92KB1.33KB0.00%
assets/images/admin/icon-info-21x21.png0.41KB0.34KB▼ 18.20%