84% custom-conditions-for-woocommerce

Code Review | Custom Conditions For WooCommerce

WordPress plugin Custom Conditions For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: custom-conditions...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 6.3.1
  • First release: Jul 15, 2021
  • Latest release: Jan 27, 2022
  • Number of updates: 10
  • Update frequency: every 19.6 days
  • Top authors: upss1988 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /449 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.80ms] Passed 4 tests

A check of server-side resources used by Custom Conditions For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.05 ▼2.03
Dashboard /wp-admin3.31 ▲0.0050.55 ▼2.29
Posts /wp-admin/edit.php3.36 ▲0.0050.54 ▼6.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.87 ▼20.72
Media Library /wp-admin/upload.php3.23 ▲0.0040.28 ▲3.03

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Conditions For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼1.084.48 ▲2.3440.36 ▼7.75
Dashboard /wp-admin2,209 ▲184.87 ▲0.00108.24 ▼6.9843.07 ▲0.63
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0437.32 ▲1.0334.59 ▲0.14
Add New Post /wp-admin/post-new.php1,397 ▼11717.81 ▲0.29609.03 ▼87.2045.45 ▼10.11
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.06105.09 ▼1.3146.54 ▲0.65

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'CCW_PLUGIN_PATH/admin/api/class-ccw-settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-conditions-for-woocommerce/admin/class-ccw-admin.php on line 14
    • > PHP Warning
      include(CCW_PLUGIN_PATH/admin/api/class-ccw-settings.php): failed to open stream: No such file or directory in wp-content/plugins/custom-conditions-for-woocommerce/admin/class-ccw-admin.php on line 14
    • > PHP Warning
      include(CCW_PLUGIN_PATH/admin/api/class-ccw-settings.php): failed to open stream: No such file or directory in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php on line 11
    • > PHP Warning
      Use of undefined constant CCW_PLUGIN_PATH - assumed 'CCW_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php on line 12
    • > PHP Warning
      include(CCW_PLUGIN_PATH/public/class-ccw-public.php): failed to open stream: No such file or directory in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php on line 12
    • > PHP Warning
      include(): Failed opening 'CCW_PLUGIN_PATH/public/class-ccw-public.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php on line 12
    • > PHP Warning
      include(): Failed opening 'CCW_PLUGIN_PATH/admin/api/class-ccw-settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Ccw_Public' not found in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-conditions.php:15
    • > PHP Warning
      include(): Failed opening 'CCW_PLUGIN_PATH/public/class-ccw-conditions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-conditions-for-woocommerce/public/class-ccw-public.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-conditions-for-woocommerce/admin/api/class-ccw-settings.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

custom-conditions-for-woocommerce/custom-conditions-for-woocommerce.php Passed 13 tests

The main PHP file in "Custom Conditions For WooCommerce" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
109 characters long description:
If you want quickly to show/hide/rename most of the functionalities in WooCommerce, this is the right plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin597 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8127180499
PO File1394496
CSS1001
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.33
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods5398.15%
▷ Protected methods11.85%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
PNG images were not found in this plugin