83% restock-product-after-purchase

Code Review | Restock product after purchase

WordPress plugin Restock product after purchase scored83%from 54 tests.

About plugin

  • Plugin page: restock-product-a...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 1, 2021
  • Latest release: Apr 1, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: oleksandr87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /311 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼11.08ms] Passed 4 tests

An overview of server-side resources used by Restock product after purchase
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.03 ▼4.20
Dashboard /wp-admin3.31 ▼0.0355.63 ▼5.27
Posts /wp-admin/edit.php3.36 ▲0.0148.22 ▼6.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.73 ▼28.69
Media Library /wp-admin/upload.php3.23 ▲0.0134.94 ▼2.07

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Restock product after purchase
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.20 ▼0.991.80 ▲0.0743.89 ▲4.31
Dashboard /wp-admin2,221 ▲155.84 ▼0.06112.33 ▲8.8545.42 ▲1.04
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0236.24 ▼4.4334.86 ▼3.32
Add New Post /wp-admin/post-new.php1,555 ▲1018.28 ▼4.93610.89 ▼68.5058.53 ▼3.45
Media Library /wp-admin/upload.php1,394 ▼34.26 ▼0.05101.75 ▼13.0944.89 ▼3.65

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 successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restock-product-after-purchase/ust_restockproductafterpurchase.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

restock-product-after-purchase/ust_restockproductafterpurchase.php 85% from 13 tests

"Restock product after purchase" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("restock-product-after-purchase.php" instead of "ust_restockproductafterpurchase.php")
  • Description: The description should be shorter than 140 characters (currently 206 characters long)

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
Good job! No executable or dangerous file extensions detected15 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP171715

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions1
▷ Named functions1100.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
PNG images were not found in this plugin