93% magic-popups

Code Review | Magic Popups

WordPress plugin Magic Popups scored 93% from 53 tests.

About plugin

  • Plugin page: magic-popups
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.4.2
  • WordPress version: 5.8.1
  • First release: Mar 24, 2016
  • Latest release: Jun 9, 2016
  • Number of updates: 21
  • Update frequency: every 3.7 days
  • Top authors: vozax (100%)

Code review

53 tests

User reviews

17 reviews

Install metrics

60+ active / 4,686 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼302.50ms] Passed 4 tests

A check of server-side resources used by Magic Popups
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1732.74 ▲11.88
Dashboard /wp-admin3.12 ▲0.0746.10 ▲0.89
Posts /wp-admin/edit.php3.23 ▲0.1241.06 ▼3.01
Add New Post /wp-admin/post-new.php5.48 ▲0.0597.24 ▼1,201.09
Media Library /wp-admin/upload.php3.06 ▲0.0531.46 ▼6.79

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Magic Popups: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲11916.26 ▲0.808.48 ▲0.8449.00 ▲0.70
Dashboard /wp-admin2,977 ▲1276.03 ▲0.11134.57 ▲1.24126.45 ▲21.71
Posts /wp-admin/edit.php2,741 ▲352.70 ▼0.0060.49 ▼3.9284.49 ▲4.34
Add New Post /wp-admin/post-new.php1,605 ▼25221.40 ▲2.26292.92 ▼76.58106.62 ▲2.18
Media Library /wp-admin/upload.php1,739 ▼335.03 ▲0.02124.92 ▼16.88135.10 ▲17.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/magic-popups/admin/partials/magic-popups-admin-display.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/magic-popups/public/partials/magicpopups-public-display.php:105
    • > PHP Notice
      Undefined index: title in wp-content/plugins/magic-popups/admin/partials/magic-popups-admin-display.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (The popup display settings for on load page), #2 (Popup display for on wait settings), #3 (Small Popup Or center Popup), #4 (Full Window Popup), #5 (Using Shortcode in widgets), #6 (Youtube video), #7 (Facebook Like Box), #8 (Google Maps), #9 (Full Popup Display)
  • Tags: There are too many tags (45 tag instead of maximum 10)
Please take inspiration from this readme.txt

magic-popups/magicpopups.php 77% from 13 tests

The principal PHP file in "Magic Popups" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("magic-popups.php" instead of "magicpopups.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,197 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS48061664
PHP12153562312
JavaScript557135221

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity1.29
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.07
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2385.19%
▷ Protected methods00.00%
▷ Private methods414.81%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 1.32MB with 0.85MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png42.83KB19.89KB▼ 53.56%
screenshot-1.png38.64KB15.98KB▼ 58.63%
screenshot-2.png45.43KB19.24KB▼ 57.64%
screenshot-7.png282.02KB75.15KB▼ 73.35%
screenshot-9.png333.92KB79.31KB▼ 76.25%