94% modal-popup

Code Review | Modal Popup

WordPress plugin Modal Popup scored 94% from 54 tests.

About plugin

  • Plugin page: modal-popup
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9
  • WordPress version: 5.9.2
  • First release: Jun 16, 2016
  • Latest release: Nov 19, 2017
  • Number of updates: 27
  • Update frequency: every 19.3 days
  • Top authors: PluginlySpeaking (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active / 11,253 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼290.54ms] Passed 4 tests

Analyzing server-side resources used by Modal Popup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1154.53 ▲2.07
Dashboard /wp-admin3.49 ▲0.0834.24 ▲0.90
Posts /wp-admin/edit.php3.71 ▲0.0739.03 ▲1.21
Add New Post /wp-admin/post-new.php7.02 ▲0.0594.81 ▼1,166.33
Media Library /wp-admin/upload.php3.42 ▲0.1326.99 ▲2.11
Add New /wp-admin/post-new.php?post_type=psmp_modal3.6437.41
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.4423.17
Popups /wp-admin/edit.php?post_type=psmp_modal3.4724.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Modal Popup
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,957 ▲20316.59 ▲1.019.13 ▲3.392.70 ▲0.26
Dashboard /wp-admin2,973 ▲1126.06 ▼0.14118.09 ▼20.14172.80 ▲3.31
Posts /wp-admin/edit.php2,768 ▲743.25 ▲0.0166.80 ▲2.72158.35 ▲13.23
Add New Post /wp-admin/post-new.php1,812 ▲14622.63 ▲2.13430.99 ▲6.09160.03 ▲2.17
Media Library /wp-admin/upload.php1,786 ▲885.59 ▲0.09152.03 ▲1.14207.36 ▲11.15
Add New /wp-admin/post-new.php?post_type=psmp_modal1,9483.92104.00144.12
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,2812.4254.57120.54
Popups /wp-admin/edit.php?post_type=psmp_modal1,4593.1760.85132.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 75% 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)
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/modal-popup/inc/cmb2-conditionals/cmb2-conditionals.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/modal-popup/inc/class-tgm-plugin-activation.php:1883
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/modal-popup/inc/class-tgm-plugin-activation.php:1883

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #6 (Finding the shortcode (admin view)) image required
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

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

The main PHP script in "Modal Popup" version 1.2.1 is automatically included on every request by WordPress
71 characters long description:
Modal Popup is the easiest and fastest way to add a popup to your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,079 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP55981,5212,478
CSS29141328
JavaScript35627273

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity44.14
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods94
▷ Static methods55.32%
▷ Public methods7478.72%
▷ Protected methods2021.28%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
12 PNG files occupy 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/half_colored_close.png1.86KB0.75KB▼ 59.86%
img/modern.png14.49KB5.38KB▼ 62.90%
img/light.png9.00KB3.95KB▼ 56.13%
img/half_colored.png19.04KB6.84KB▼ 64.08%
img/full_picture.png75.79KB26.26KB▼ 65.35%