79% product-expiry-for-woocommerce

Code Review | Product Expiry for WooCommerce

WordPress plugin Product Expiry for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: product-expiry-fo...
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 20, 2021
  • Latest release: Aug 9, 2023
  • Number of updates: 18
  • Update frequency: every 43.7 days
  • Top authors: webcodingplace (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

900+ active /5,762 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.92ms] Passed 4 tests

Analyzing server-side resources used by Product Expiry for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0424.90 ▼11.54
Dashboard /wp-admin3.35 ▲0.0445.72 ▼5.35
Posts /wp-admin/edit.php3.40 ▲0.0445.25 ▼2.63
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.13 ▼8.15
Media Library /wp-admin/upload.php3.27 ▲0.0434.29 ▲1.55
Expiry Settings /wp-admin/edit.php?post_type=product&page=products_expiry_settings3.0423.57

Server storage [IO: ▲0.04MB] [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: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Product Expiry for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,465 ▼27013.19 ▼1.190.68 ▼0.8916.61 ▼31.53
Dashboard /wp-admin2,209 ▲214.84 ▼1.1997.23 ▲0.7039.05 ▼7.74
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0134.15 ▼7.3430.10 ▼6.55
Add New Post /wp-admin/post-new.php1,542 ▲2318.15 ▼5.24604.15 ▼49.2264.72 ▲11.56
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0094.01 ▼5.0342.59 ▼1.35
Expiry Settings /wp-admin/edit.php?post_type=product&page=products_expiry_settings280.440.123.96

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
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/product-expiry-for-woocommerce/menu/settings.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=product&page=products_expiry_settings
    • > Network (severe)
    wp-admin/edit.php?post_type=product&page=products_expiry_settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woocommerce, woo notifications, product, product expiry, woo

product-expiry-for-woocommerce/product-expiry-for-woocommerce.php Passed 13 tests

"Product Expiry for WooCommerce" version 2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
68 characters long description:
Provide expiry date for your products and get notified before expire

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin696 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP39845597
PO File1222564
JavaScript31035

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity67.00
▷ Minimum class complexity67.00
▷ Maximum class complexity67.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin