84% craftwork-utilities-for-woocommerce

Code Review | Craftwork Utilities for Woocommerce

WordPress plugin Craftwork Utilities for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: craftwork-utiliti...
  • Plugin version: 1.3.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8
  • WordPress version: 6.3.1
  • First release: Aug 22, 2020
  • Latest release: Oct 11, 2021
  • Number of updates: 26
  • Update frequency: every 16.0 days
  • Top authors: palagorn.p (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /570 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.00MB] [CPU: ▼8.22ms] Passed 4 tests

This is a short check of server-side resources used by Craftwork Utilities for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.32 ▼4.19
Dashboard /wp-admin3.31 ▲0.0048.58 ▼7.58
Posts /wp-admin/edit.php3.36 ▲0.0049.40 ▲1.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.38 ▼22.11
Media Library /wp-admin/upload.php3.23 ▲0.0036.68 ▲2.97

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Craftwork Utilities for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.27 ▼0.341.79 ▼0.1440.71 ▼4.47
Dashboard /wp-admin2,198 ▲215.61 ▼0.0393.30 ▼15.6938.13 ▼7.54
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0539.60 ▼0.8935.10 ▼1.01
Add New Post /wp-admin/post-new.php1,526 ▼023.61 ▲0.53678.55 ▲72.2052.98 ▼3.55
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.0494.82 ▼13.9542.83 ▼1.95

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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant CWUT_DIR - assumed 'CWUT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/craftwork-utilities-for-woocommerce/includes/class-cwut-core.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/craftwork-utilities-for-woocommerce/includes/class-cwut-settings-page.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/craftwork-utilities-for-woocommerce/craftwork-wc-utilities.php:15
    • > PHP Fatal error
      require(): Failed opening required 'CWUT_DIRincludes/class-cwut-variation.php' (include_path='.:/usr/share/php') in wp-content/plugins/craftwork-utilities-for-woocommerce/includes/class-cwut-core.php on line 6
    • > PHP Warning
      require(CWUT_DIRincludes/class-cwut-variation.php): failed to open stream: No such file or directory in wp-content/plugins/craftwork-utilities-for-woocommerce/includes/class-cwut-core.php on line 6

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: woocommerce, enhancement

craftwork-utilities-for-woocommerce/craftwork-wc-utilities.php 92% from 13 tests

The primary PHP file in "Craftwork Utilities for Woocommerce" version 1.3.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("craftwork-utilities-for-woocommerce.php" instead of "craftwork-wc-utilities.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,345 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP52161161,058
PO File194104247
CSS34028
JavaScript14112

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.45
Average class complexity30.25
▷ Minimum class complexity7.00
▷ Maximum class complexity61.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods3183.78%
▷ Public methods3389.19%
▷ Protected methods00.00%
▷ Private methods410.81%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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