72% wc-expire-products

Code Review | WC Expired Products

WordPress plugin WC Expired Products scored72%from 54 tests.

About plugin

  • Plugin page: wc-expire-products
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 23, 2016
  • Latest release: Aug 23, 2016
  • Number of updates: 5
  • Update frequency: every 3.6 days
  • Top authors: nicogaldo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,444 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.76ms] Passed 4 tests

An overview of server-side resources used by WC Expired Products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0347.74 ▲7.73
Dashboard /wp-admin3.33 ▲0.0349.29 ▼1.36
Posts /wp-admin/edit.php3.39 ▲0.0347.83 ▼1.10
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.78 ▼13.13
Media Library /wp-admin/upload.php3.26 ▲0.0338.95 ▲4.56
Expired Products /wp-admin/admin.php?page=wc-expired-products3.2934.81

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WC Expired Products
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12113.69 ▼0.667.88 ▲5.9143.16 ▼2.53
Dashboard /wp-admin2,202 ▲225.50 ▼0.0888.02 ▼8.5740.54 ▼1.35
Posts /wp-admin/edit.php2,110 ▲101.99 ▼0.0134.93 ▼4.3338.53 ▼0.27
Add New Post /wp-admin/post-new.php1,536 ▲1023.11 ▼0.17695.25 ▲50.8857.83 ▼3.27
Media Library /wp-admin/upload.php1,413 ▲134.23 ▲0.04110.51 ▲5.1747.33 ▲2.30
Expired Products /wp-admin/admin.php?page=wc-expired-products9531.6924.6138.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wc-expired-products
    • > Notice in wp-content/plugins/wc-expire-products/admin/partials/wc-expired-products-admin-display.php+39
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-expire-products/public/partials/wc-expired-products-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wc-expire-products/admin/partials/wc-expired-products-admin-display.php:17

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === wc-expire-products === )
  • Donate link: Invalid url: "nicogaldo.com.ar"
You can look at the official readme.txt

wc-expire-products/wc-expired-products.php 85% from 13 tests

The principal PHP file in "WC Expired Products" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-expire-products.php" instead of "wc-expired-products.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected703 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12280625516
PO File14849180
JavaScript24546
CSS2181

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.71
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3286.49%
▷ Protected methods00.00%
▷ Private methods513.51%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin