10% before-deleting-the-posts

Code Review | Before deleting the posts

WordPress plugin Before deleting the posts scored 10% from 54 tests.

About plugin

  • Plugin page: before-deleting-t...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 5.8.1
  • First release: Dec 2, 2014
  • Latest release: Dec 2, 2014
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: Asumaru (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 810 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php+320
    Undefined index: asm_B4DelPosts_Class

Server metrics [RAM: ▼1.77MB] [CPU: ▼185.07ms] Passed 4 tests

A check of server-side resources used by Before deleting the posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.85 ▼0.865.78 ▼16.02
Dashboard /wp-admin1.87 ▼1.185.67 ▼44.42
Posts /wp-admin/edit.php1.87 ▼1.236.10 ▼37.11
Add New Post /wp-admin/post-new.php1.87 ▼3.565.34 ▼638.27
Media Library /wp-admin/upload.php1.87 ▼1.136.18 ▼20.49

Server storage [IO: ▲0.44MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/before-deleting-the-posts/" and "wp-content/uploads/"
    • (new file) wp-content/deleted_posts/.empty
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Before deleting the posts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲10615.76 ▲0.175.55 ▼3.3546.45 ▼2.25
Dashboard /wp-admin2,966 ▲355.88 ▲0.00165.43 ▲25.08115.08 ▲1.91
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0164.23 ▼2.0290.15 ▲2.30
Add New Post /wp-admin/post-new.php1,500 ▼2,13618.65 ▲3.73368.13 ▼44.06109.73 ▼15.58
Media Library /wp-admin/upload.php1,810 ▲35.00 ▼0.00156.60 ▲5.65118.10 ▲0.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php+320
    Undefined index: asm_B4DelPosts_Class

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/before-deleting-the-posts/includes/export.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php on line 43
    • > PHP Notice
      Undefined index: asm_B4DelPosts_Class in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php on line 320
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php:45
    • > PHP Notice
      Undefined index: asm_B4DelPosts_Class in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php on line 320
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/before-deleting-the-posts/includes/before-deleting-the-posts.php on line 43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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:
  • Screenshots: Add images for these screenshots: #1 (Trigger "Delete Permanently".), #2 (Backed up deleted posts.), #3 (Backup as Export XML.)
The official readme.txt is a good inspiration

before-deleting-the-posts/before-deleting-the-posts.php Passed 13 tests

"Before deleting the posts" version 0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
43 characters long description:
This plugin backs up before deleting posts.

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
Success! There were no dangerous files found in this plugin631 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP595338631

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.40MB with 0.27MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png77.91KB23.08KB▼ 70.38%
screenshot-3.png140.13KB48.63KB▼ 65.29%
screenshot-2.png195.57KB68.53KB▼ 64.96%