68% yourplugins-wc-conditional-cart-notices

Code Review | Conditional Cart Messages for WooCommerce - YourPlugins.com

WordPress plugin Conditional Cart Messages for WooCommerce - YourPlugins.com scored 68% from 54 tests.

About plugin

  • Plugin page: yourplugins-wc-co...
  • Plugin version: 1.2.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 27, 2021
  • Latest release: Jun 26, 2023
  • Number of updates: 47
  • Update frequency: every 16.8 days
  • Top authors: yourplugins (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 1,924 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.66MB] [CPU: ▲5.80ms] Passed 4 tests

Server-side resources used by Conditional Cart Messages for WooCommerce - YourPlugins.com
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7551.30 ▲9.38
Dashboard /wp-admin3.96 ▲0.6658.71 ▲11.79
Posts /wp-admin/edit.php4.06 ▲0.7057.61 ▲14.10
Add New Post /wp-admin/post-new.php6.52 ▲0.6485.87 ▼6.45
Media Library /wp-admin/upload.php3.86 ▲0.6440.80 ▲8.48
YourPlugins /wp-admin/admin.php?page=yourplugins5.28111.24
Conditional Cart Notices /wp-admin/admin.php?page=yourplugins-wc-conditional-cart-notices4.0546.94

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 305 new files
Database: 2 new tables, 7 new options
New tables
wp_yps_wc_conditional_cart_notices
wp_yps_wc_conditional_cart_notices_settings
New WordPress options
theysaidso_admin_options
yourplugins-wc-conditional-cart-notices
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Conditional Cart Messages for WooCommerce - YourPlugins.com
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,007 ▲27214.57 ▲0.222.60 ▲0.9237.97 ▼10.52
Dashboard /wp-admin2,366 ▲1786.46 ▲1.56121.74 ▲19.4081.90 ▲42.28
Posts /wp-admin/edit.php2,287 ▲1983.56 ▲1.5152.77 ▲17.2866.85 ▲32.55
Add New Post /wp-admin/post-new.php1,555 ▲1923.21 ▲0.30562.68 ▼61.37136.12 ▲79.82
Media Library /wp-admin/upload.php1,426 ▲354.16 ▼0.0779.47 ▼22.5885.68 ▲37.91
YourPlugins /wp-admin/admin.php?page=yourplugins1,0634.4972.0626.75
Conditional Cart Notices /wp-admin/admin.php?page=yourplugins-wc-conditional-cart-notices1,4015.2797.0561.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_yps_wc_conditional_cart_notices_settings
    • wp_yps_wc_conditional_cart_notices
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • yourplugins-wc-conditional-cart-notices
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-plugin/view/header.php
    • > /wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-plugin/view/footer.php
    • > /wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-form/view/form/field/tree-select.php
  • 186× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-core/includes/helper.php on line 220
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\Framework\\Core\\v020_769_691\\Controller' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-plugin/includes/plugin-controller.php:7
    • > PHP Warning
      Class 'YPS\\Framework\\Query_Builder\\v020_769_691\\Query_Builder_Form_Field' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/autoload/aliases.php on line 112
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\Framework\\Database\\v020_769_691\\Model' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-database/includes/session-model.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\Framework\\Core\\v020_769_691\\Base' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-form/includes/form.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\Framework\\Form\\v020_769_691\\Form_Field' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-form/includes/numeric-form-field.php:5
    • > PHP Warning
      Class 'YPS\\Framework\\Database\\v020_769_691\\Database_Helper' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/autoload/aliases.php on line 31
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\Framework\\Form\\v020_769_691\\Form_Field' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-form/includes/color-form-field.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/yourplugins-wc-conditional-cart-notices/vendor/yps/framework-form/view/form/compact-form.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'YPS\\WC_Conditional_Cart_Notices\\Framework\\Record\\Record_Model' not found in wp-content/plugins/yourplugins-wc-conditional-cart-notices/app/notice/notice-model.php:7

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes: Please take inspiration from this readme.txt

yourplugins-wc-conditional-cart-notices/yourplugins-wc-conditional-cart-notices.php 92% from 13 tests

The entry point to "Conditional Cart Messages for WooCommerce - YourPlugins.com" version 1.2.10 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected59,844 lines of code in 249 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript627,07712,04828,842
CSS3330910410,891
SVG30128,954
PHP1423,1793,4608,668
JSON51001,349
Markdown21390517
Sass1420501
PO File15354122

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.73
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces28
Interfaces1
Traits0
Classes160
▷ Abstract classes31.88%
▷ Concrete classes15798.12%
▷ Final classes00.00%
Methods844
▷ Static methods12014.22%
▷ Public methods80395.14%
▷ Protected methods354.15%
▷ Private methods60.71%
Functions17
▷ Named functions15.88%
▷ Anonymous functions1694.12%
Constants37
▷ Global constants00.00%
▷ Class constants37100.00%
▷ Public constants37100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/externals/chosen/chosen-sprite.png0.53KB0.88KB0.00%
vendor/externals/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
vendor/yps/framework-plugin/images/logo-24x24.png1.18KB0.88KB▼ 25.02%