83% receiptful-for-woocommerce

Code Review | CM Commerce for WooCommerce

WordPress plugin CM Commerce for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: receiptful-for-wo...
  • Plugin version: 1.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 2, 2014
  • Latest release: Jul 21, 2023
  • Number of updates: 82
  • Update frequency: every 38.9 days
  • Top authors: receiptful (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

300+ active /47,634 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼10.16MB] [CPU: ▼2,091,054.91ms] Passed 4 tests

Analyzing server-side resources used by CM Commerce for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0243.61 ▼1.06
Dashboard /wp-admin3.38 ▼40.7348.60 ▼8,364,201.95
Posts /wp-admin/edit.php3.49 ▲0.0954.73 ▲2.29
Add New Post /wp-admin/post-new.php5.96 ▲0.0287.60 ▼17.30
Media Library /wp-admin/upload.php3.30 ▲0.0239.70 ▲0.66

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for CM Commerce for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.33 ▲0.061.75 ▼0.0741.17 ▼6.16
Dashboard /wp-admin2,198 ▲215.58 ▼0.0291.19 ▼3.4138.24 ▼6.62
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0539.17 ▼0.0735.63 ▼0.07
Add New Post /wp-admin/post-new.php1,535 ▲518.28 ▼5.07640.39 ▼52.7666.98 ▲15.66
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0397.29 ▼11.7942.81 ▼2.75

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/receiptful-for-woocommerce/includes/emails/class-receiptful-email-customer-new-order.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

receiptful-for-woocommerce/receiptful-woocommerce.php 77% from 13 tests

The primary PHP file in "CM Commerce for WooCommerce" version 1.6.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("receiptful-for-woocommerce.php" instead of "receiptful-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.0" instead of "3.4.0")

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
Success! There were no dangerous files found in this plugin2,611 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP199291,4442,330
Sass12443113
PO File1262696
JavaScript220971
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity22.31
▷ Minimum class complexity3.00
▷ Maximum class complexity63.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods103
▷ Static methods21.94%
▷ Public methods9794.17%
▷ Protected methods43.88%
▷ Private methods21.94%
Functions27
▷ Named functions2488.89%
▷ Anonymous functions311.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin