83% restore-permanently-delete-post-or-page-data

Code Review | Restore Permanently delete Post or Page Data

WordPress plugin Restore Permanently delete Post or Page Data scored83%from 54 tests.

About plugin

  • Plugin page: restore-permanent...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1+
  • WordPress version: 6.3.1
  • First release: Mar 16, 2017
  • Latest release: Mar 20, 2017
  • Number of updates: 10
  • Update frequency: every 1.2 days
  • Top authors: pokornydavid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /3,403 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.06MB] [CPU: ▼3.43ms] Passed 4 tests

A check of server-side resources used by Restore Permanently delete Post or Page Data
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0845.98 ▲5.20
Dashboard /wp-admin3.38 ▲0.0358.52 ▼6.82
Posts /wp-admin/edit.php3.43 ▲0.0749.43 ▼1.01
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.09 ▼11.08
Media Library /wp-admin/upload.php3.30 ▲0.0744.59 ▲10.87

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: 3 new tables, 6 new options
New tables
wp_delete_posts
wp_delete_id_list
wp_delete_postmeta
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Restore Permanently delete Post or Page Data
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6114.38 ▲0.171.81 ▼0.1844.33 ▲4.04
Dashboard /wp-admin2,213 ▲335.67 ▼0.0598.86 ▲7.4641.78 ▼2.29
Posts /wp-admin/edit.php2,118 ▲182.02 ▲0.0235.30 ▼0.2235.03 ▲0.71
Add New Post /wp-admin/post-new.php1,541 ▼1817.43 ▼1.05655.69 ▲31.8948.49 ▼8.15
Media Library /wp-admin/upload.php1,418 ▲154.24 ▲0.08110.77 ▲10.2346.62 ▲1.13

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

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)
Everything seems fine, however this is by no means 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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/restore-permanently-delete-post-or-page-data/delete-store-file.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/restore-permanently-delete-post-or-page-data/setting.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tested up to: The plugin version is formatted incorrectly
  • Screenshots: These screenshots do not have images: #1 (Screenshot 'screenshot-1.png' shows all the possible options available for this plugin.), #2 (Screenshot 'screenshot-2.png' shows front end view for the first screen of this plugin.)
The official readme.txt might help

restore-permanently-delete-post-or-page-data/delete-store-file.php 77% from 13 tests

The main PHP script in "Restore Permanently delete Post or Page Data" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("restore-permanently-delete-post-or-page-data.php" instead of "delete-store-file.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin477 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24539427
JavaScript13050

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
2 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png83.36KB31.98KB▼ 61.64%
screenshot-1.png105.66KB39.10KB▼ 63.00%