83% prevent-pages-from-deleting

Code Review | Prevent Pages From Deleting

WordPress plugin Prevent Pages From Deleting scored83%from 54 tests.

About plugin

  • Plugin page: prevent-pages-fro...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Sep 7, 2015
  • Latest release: Nov 24, 2020
  • Number of updates: 19
  • Update frequency: every 100.3 days
  • Top authors: AboZain (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /2,179 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.99ms] Passed 4 tests

A check of server-side resources used by Prevent Pages From Deleting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.05 ▼1.63
Dashboard /wp-admin3.33 ▼0.0244.58 ▼11.00
Posts /wp-admin/edit.php3.38 ▲0.0249.01 ▲3.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.83 ▼14.50
Media Library /wp-admin/upload.php3.25 ▲0.0238.88 ▲3.16
Prevent Deleting /wp-admin/options-general.php?page=prevent_deleting3.2333.12

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Prevent Pages From Deleting
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.64 ▲0.011.57 ▼0.1839.87 ▼4.23
Dashboard /wp-admin2,202 ▲225.62 ▲0.0081.90 ▼13.6241.47 ▲2.91
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0634.66 ▼6.1934.15 ▼4.74
Add New Post /wp-admin/post-new.php1,531 ▼523.27 ▲4.84693.35 ▲54.9654.43 ▼14.45
Media Library /wp-admin/upload.php1,401 ▲74.18 ▼0.03107.78 ▲13.0747.99 ▲3.38
Prevent Deleting /wp-admin/options-general.php?page=prevent_deleting8022.0323.5426.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× 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/prevent-pages-from-deleting/prevent-posts-from-deleting.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Screenshots: Please add an image for screenshot #1 (This screen shot description the plugin settings.)
  • Screenshots: A description for screenshot #2 is required in prevent-pages-from-deleting/assets to your readme.txt
Please take inspiration from this readme.txt

prevent-pages-from-deleting/prevent-posts-from-deleting.php 92% from 13 tests

The main PHP file in "Prevent Pages From Deleting" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("prevent-pages-from-deleting.php" instead of "prevent-posts-from-deleting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin123 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172288
PO File1519928
HTML1007

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected