83% catalog-enquiry

Code Review | Catalog & Enquiry For WooCommerce

WordPress plugin Catalog & Enquiry For WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: catalog-enquiry
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Mar 12, 2021
  • Latest release: Mar 23, 2021
  • Number of updates: 3
  • Update frequency: every 3.7 days
  • Top authors: itechtheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,236 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▲2.96ms] Passed 4 tests

This is a short check of server-side resources used by Catalog & Enquiry For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4945.43 ▲5.69
Dashboard /wp-admin3.79 ▲0.4949.90 ▲0.13
Posts /wp-admin/edit.php3.84 ▲0.4955.78 ▲7.98
Add New Post /wp-admin/post-new.php6.31 ▲0.4295.53 ▼1.97
Media Library /wp-admin/upload.php3.65 ▲0.4243.30 ▲9.39
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.7234.65

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Catalog & Enquiry For WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲8113.62 ▼0.744.52 ▲2.0543.57 ▼1.20
Dashboard /wp-admin2,241 ▲504.81 ▼1.09107.53 ▲12.9448.24 ▲7.33
Posts /wp-admin/edit.php2,135 ▲462.10 ▲0.0941.39 ▲4.2041.27 ▲8.78
Add New Post /wp-admin/post-new.php1,545 ▲317.75 ▼0.48643.95 ▲22.3246.89 ▼9.71
Media Library /wp-admin/upload.php1,434 ▲494.33 ▲0.08100.08 ▼5.0948.81 ▲5.91
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9872.0625.1430.09

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catalog-enquiry/inc/remove-cart.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catalog-enquiry/inc/style.php:93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/catalog-enquiry/lib/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/catalog-enquiry/inc/settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catalog-enquiry/inc/form.php:25

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Setting Page), #2 (Product Archive Page), #3 (Single Product Page)
You can look at the official readme.txt

catalog-enquiry/index.php 85% from 13 tests

"Catalog & Enquiry For WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("catalog-enquiry.php" instead of "index.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin2,263 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP75631,6842,066
PO File17980197

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity37.67
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods108
▷ Static methods109.26%
▷ Public methods8578.70%
▷ Protected methods2321.30%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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