78% zwp-modal

Code Review | ZWP Modal

WordPress plugin ZWP Modal scored78%from 54 tests.

About plugin

  • Plugin page: zwp-modal
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.2
  • WordPress version: 6.3.1
  • First release: Nov 1, 2017
  • Latest release: Nov 2, 2017
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: rardoz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /796 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by ZWP Modal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.15 ▲3.44
Dashboard /wp-admin3.37 ▲0.0754.17 ▲2.29
Posts /wp-admin/edit.php3.49 ▲0.1364.43 ▲11.69
Add New Post /wp-admin/post-new.php5.97 ▲0.09104.40 ▲7.81
Media Library /wp-admin/upload.php3.30 ▲0.0738.10 ▼1.89
ZWP Modal /wp-admin/options-general.php?page=zwp-modal3.2430.92

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

ZWP Modal: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.47 ▲0.171.88 ▼0.2345.15 ▲3.06
Dashboard /wp-admin2,214 ▲264.87 ▼1.02114.72 ▲5.3241.07 ▼2.79
Posts /wp-admin/edit.php2,100 ▲112.01 ▲0.0239.32 ▲2.8736.79 ▼0.38
Add New Post /wp-admin/post-new.php1,522 ▼623.53 ▲5.35655.84 ▼26.0251.88 ▼7.66
Media Library /wp-admin/upload.php1,399 ▲114.17 ▼0.0196.85 ▼9.3439.98 ▼10.49
ZWP Modal /wp-admin/options-general.php?page=zwp-modal7942.0223.0324.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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/options-general.php?page=zwp-modal
    • > Warning in wp-content/plugins/zwp-modal/admin/class-zwp-modal-admin.php+119
    Invalid argument supplied for foreach()

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
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/public/partials/zwp-modal-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/public/partials/zwp-modal-js.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/admin/partials/zwp-modal-autocomplete.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/zwp-modal/admin/partials/zwp-modal-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/public/partials/zwp-modal-css.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/admin/partials/zwp-modal-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zwp-modal/public/partials/zwp-modal-close-button.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === zwp-modal === )
  • Screenshots: These screenshots need descriptions #2, #0 in zwp-modal/assets to your readme.txt
The official readme.txt is a good inspiration

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

The primary PHP file in "ZWP Modal" version 1.0.0 is used by WordPress to initiate all plugin functionality
36 characters long description:
A pop-up modal plugin for wordpress.

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
There were no executable files found in this plugin700 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17150500679
Markdown111018
JavaScript12273
CSS1040

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.39
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2374.19%
▷ Protected methods39.68%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.76MB with 0.54MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot_1.png585.74KB193.96KB▼ 66.89%
assets/settings.png191.40KB48.01KB▼ 74.92%