78% disable-delete-post-or-page-link-wordpress-plugin

Code Review | Disable Delete Post or Page

WordPress plugin Disable Delete Post or Page scored 78% from 54 tests.

About plugin

  • Plugin page: disable-delete-po...
  • Plugin version: 3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.1-4.9
  • WordPress version: 6.3.1
  • First release: Jun 5, 2012
  • Latest release: Jan 16, 2019
  • Number of updates: 24
  • Update frequency: every 100.7 days
  • Top authors: jeremyselph (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 4,195 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼18.86ms] Passed 4 tests

A check of server-side resources used by Disable Delete Post or Page
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0838.66 ▼6.52
Dashboard /wp-admin3.25 ▼0.0533.36 ▼16.17
Posts /wp-admin/edit.php3.32 ▼0.0435.52 ▼14.51
Add New Post /wp-admin/post-new.php5.50 ▼0.3871.36 ▼37.19
Media Library /wp-admin/upload.php3.26 ▲0.0331.84 ▼7.56
Disable delete link /wp-admin/options-general.php?page=rd-disable-delete-post-or-page3.1128.89

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Disable Delete Post or Page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.26 ▼1.121.53 ▼0.2538.64 ▼11.74
Dashboard /wp-admin2,210 ▲254.88 ▼0.9895.40 ▼5.8141.80 ▼2.04
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0133.38 ▼9.1133.03 ▼3.96
Add New Post /wp-admin/post-new.php1,539 ▲2523.22 ▲5.75664.93 ▲60.1357.75 ▲4.51
Media Library /wp-admin/upload.php1,386 ▼24.21 ▲0.0092.96 ▼11.7343.73 ▲1.59
Disable delete link /wp-admin/options-general.php?page=rd-disable-delete-post-or-page1,0172.0325.4228.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=rd-disable-delete-post-or-page
    • > Notice in wp-content/plugins/disable-delete-post-or-page-link-wordpress-plugin/js_disable_delete_post.php+208
    Trying to get property 'post_type' of non-object
    • > GET request to /wp-admin/options-general.php?page=rd-disable-delete-post-or-page
    • > Notice in wp-content/plugins/disable-delete-post-or-page-link-wordpress-plugin/js_disable_delete_post.php+157
    Undefined index: post

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/disable-delete-post-or-page-link-wordpress-plugin/js_disable_delete_post.php:81

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

disable-delete-post-or-page-link-wordpress-plugin/js_disable_delete_post.php 92% from 13 tests

The main PHP script in "Disable Delete Post or Page" version 3.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("disable-delete-post-or-page-link-wordpress-plugin.php" instead of "js_disable_delete_post.php")

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
No dangerous file extensions were detected313 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP198134260
JavaScript1172724
Markdown114020
CSS13139

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin