83% woocommerce-product-generator

Code Review | WooCommerce Product Generator

WordPress plugin WooCommerce Product Generator scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0
  • WordPress version: 6.3.1
  • First release: Mar 13, 2015
  • Latest release: Aug 11, 2022
  • Number of updates: 20
  • Update frequency: every 135.4 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

800+ active / 23,183 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.66ms] Passed 4 tests

Server-side resources used by WooCommerce Product Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.22 ▲4.27
Dashboard /wp-admin3.45 ▲0.1549.40 ▲0.50
Posts /wp-admin/edit.php3.56 ▲0.2146.43 ▼0.60
Add New Post /wp-admin/post-new.php6.03 ▲0.1594.69 ▼7.96
Media Library /wp-admin/upload.php3.37 ▲0.1534.21 ▼2.59

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Product Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.34 ▼1.051.64 ▼0.2041.42 ▲0.81
Dashboard /wp-admin2,209 ▲234.86 ▼0.21104.19 ▼0.0942.46 ▲3.65
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0436.42 ▼0.6333.98 ▼0.64
Add New Post /wp-admin/post-new.php1,514 ▼1917.48 ▼5.73648.04 ▼20.2253.64 ▼0.98
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.0595.50 ▼4.0041.91 ▼2.78

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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)
Good news, no errors were detected

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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-product-generator/views/admin-generator.php:12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-product-generator/woocommerce-product-generator.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-generator/woocommerce-product-generator.php:1156

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please describe screenshot #6 in woocommerce-product-generator/assets to your readme.txt
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

woocommerce-product-generator/woocommerce-product-generator.php 92% from 13 tests

The main PHP script in "WooCommerce Product Generator" version 2.1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.5" instead of "5.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin6,045 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JSON2004,925
PHP2152242915
JavaScript32961193
CSS10199
Markdown1103

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity144.00
▷ Minimum class complexity144.00
▷ Maximum class complexity144.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods26100.00%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants436.36%
▷ Class constants763.64%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/placeholder.png12.08KB4.35KB▼ 63.97%