84% discontinued-products

Code Review | Discontinued Products

WordPress plugin Discontinued Products scored84%from 54 tests.

About plugin

  • Plugin page: discontinued-prod...
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2016
  • Latest release: Jul 31, 2019
  • Number of updates: 36
  • Update frequency: every 30.9 days
  • Top authors: twoelevenjay (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

700+ active /4,934 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.93ms] Passed 4 tests

A check of server-side resources used by Discontinued Products
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.80 ▼5.98
Dashboard /wp-admin3.31 ▲0.0150.55 ▲0.72
Posts /wp-admin/edit.php3.36 ▲0.0154.44 ▲3.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.22 ▼5.97
Media Library /wp-admin/upload.php3.23 ▲0.0140.93 ▲4.91

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Discontinued Products
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼1.385.29 ▲3.0043.65 ▼4.24
Dashboard /wp-admin2,209 ▲214.89 ▼0.00113.40 ▲12.7943.26 ▲1.88
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0441.61 ▼1.1934.87 ▼4.33
Add New Post /wp-admin/post-new.php1,514 ▼1917.51 ▼5.65647.12 ▼5.4165.61 ▲12.99
Media Library /wp-admin/upload.php1,388 ▼34.18 ▼0.04100.11 ▼6.0342.97 ▼4.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/discontinued-products/woocommerce-template.php:108
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/discontinued-products/woocommerce-discontinued-products.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/discontinued-products/includes/wc-class-dp-discontinued-product.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/discontinued-products/includes/wc-class-dp-settings.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: woocommerce products, woocommerce, discontinued, ecommerce, discontinued products

discontinued-products/woocommerce-discontinued-products.php 85% from 13 tests

"Discontinued Products" version 1.1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("discontinued-products.php" instead of "woocommerce-discontinued-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected509 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6111331505
CSS1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.40
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2996.67%
▷ Protected methods13.33%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
There are no PNG files in this plugin