84% wp-magnific-popup

Code Review | WP Magnific Popup

WordPress plugin WP Magnific Popup scored84%from 54 tests.

About plugin

  • Plugin page: wp-magnific-popup
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Jul 14, 2016
  • Latest release: Oct 31, 2016
  • Number of updates: 14
  • Update frequency: every 7.8 days
  • Top authors: firimar (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /13,998 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.90ms] Passed 4 tests

Analyzing server-side resources used by WP Magnific Popup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.37 ▼0.18
Dashboard /wp-admin3.32 ▲0.0248.34 ▲3.66
Posts /wp-admin/edit.php3.37 ▲0.0242.53 ▼6.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.24 ▼20.58
Media Library /wp-admin/upload.php3.24 ▲0.0233.63 ▼0.73
WP Magnific Popup /wp-admin/options-general.php?page=wp-magnific-popup3.2128.24

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
wpmp_iframe_settings
wpmp_image_settings
widget_recent-comments
widget_recent-posts
wpmp_div_settings
wpmp_gallery_settings
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Magnific Popup
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲15013.61 ▼0.827.47 ▲5.5838.35 ▲1.60
Dashboard /wp-admin2,210 ▲184.86 ▼0.29105.00 ▼11.2343.14 ▲1.02
Posts /wp-admin/edit.php2,090 ▲42.05 ▲0.0633.25 ▼7.7736.13 ▼3.65
Add New Post /wp-admin/post-new.php1,517 ▼1117.60 ▼5.57675.73 ▲67.2055.89 ▲2.08
Media Library /wp-admin/upload.php1,392 ▲44.23 ▲0.0595.60 ▼2.9440.78 ▼7.20
WP Magnific Popup /wp-admin/options-general.php?page=wp-magnific-popup1,1072.0647.3039.72

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 10 options
    • wpmp_div_settings
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • wpmp_iframe_settings
    • wpmp_image_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wpmp_gallery_settings
    • db_upgraded

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-magnific-popup/wp_magnific_popup.php:15

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-magnific-popup === )
The official readme.txt might help

wp-magnific-popup/wp_magnific_popup.php 92% from 13 tests

The main PHP script in "WP Magnific Popup" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-magnific-popup.php" instead of "wp_magnific_popup.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin651 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS1356310
PHP13210237
JavaScript34363
PO File1121241

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin