73% wp-confirm

Code Review | WP Confirm

WordPress plugin WP Confirm scored73%from 54 tests.

About plugin

  • Plugin page: wp-confirm
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2020
  • Latest release: Oct 14, 2020
  • Number of updates: 18
  • Update frequency: every 32.0 days
  • Top authors: firdousi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.06MB] [CPU: ▼14.28ms] Passed 4 tests

Server-side resources used by WP Confirm
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0742.40 ▲1.51
Dashboard /wp-admin3.36 ▲0.0150.43 ▼18.14
Posts /wp-admin/edit.php3.49 ▲0.1345.97 ▼5.29
Add New Post /wp-admin/post-new.php5.51 ▼0.3783.20 ▼26.37
Media Library /wp-admin/upload.php3.27 ▲0.0432.52 ▼7.31
WP Confirm /wp-admin/options-general.php?page=wp-confirm3.2432.34

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
wp_confirm_option_name
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WP Confirm
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲12413.37 ▼0.908.59 ▲6.3342.68 ▼0.34
Dashboard /wp-admin2,208 ▲285.64 ▲0.0695.90 ▲2.6841.48 ▼0.10
Posts /wp-admin/edit.php2,114 ▲112.02 ▲0.0835.97 ▼2.7833.28 ▼0.37
Add New Post /wp-admin/post-new.php1,550 ▲2218.32 ▼4.98657.38 ▼43.5079.27 ▲19.91
Media Library /wp-admin/upload.php1,411 ▲144.21 ▲0.07107.60 ▲2.8643.94 ▼2.21
WP Confirm /wp-admin/options-general.php?page=wp-confirm8152.0325.8032.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • wp_confirm_option_name
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-confirm
    • > Notice in wp-content/plugins/wp-confirm/admin/class-wp-confirm-admin.php+250
    Undefined index: enable_confirm_on_permalink_save_2

SRP 0% 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
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-confirm/trunk/admin/partials/wp-confirm-admin-display.php
    • > /wp-content/plugins/wp-confirm/admin/partials/wp-confirm-admin-display.php
    • > /wp-content/plugins/wp-confirm/public/partials/wp-confirm-public-display.php
    • > /wp-content/plugins/wp-confirm/trunk/public/partials/wp-confirm-public-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-confirm/admin/class-wp-confirm-admin.php:229
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-confirm/trunk/admin/class-wp-confirm-admin.php:229

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires php: Invalid version format
Please take inspiration from this readme.txt

wp-confirm/wp-confirm.php Passed 13 tests

The main file in "WP Confirm" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
57 characters long description:
Adds a confirm dialog on saving post, menu and permalinks

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin301 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12157553295
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods64
▷ Static methods46.25%
▷ Public methods5484.38%
▷ Protected methods00.00%
▷ Private methods1015.62%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin