73% role-and-customer-based-pricing-for-woocommerce

Code Review | WooCommerce Role Based Pricing by Meow Crew

WordPress plugin WooCommerce Role Based Pricing by Meow Crew scored73%from 54 tests.

About plugin

  • Plugin page: role-and-customer...
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Jan 11, 2022
  • Latest release: Nov 16, 2023
  • Number of updates: 19
  • Update frequency: every 35.5 days
  • Top authors: meowcrew (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /11,479 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.03MB] [CPU: ▲24.76ms] 75% from 4 tests

A check of server-side resources used by WooCommerce Role Based Pricing by Meow Crew
Please have a look at the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.03MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.92 ▲5.4564.62 ▲25.73
Dashboard /wp-admin8.94 ▲5.5992.34 ▲30.79
Posts /wp-admin/edit.php8.94 ▲5.5882.03 ▲36.12
Add New Post /wp-admin/post-new.php9.39 ▲3.50116.01 ▲12.60
Media Library /wp-admin/upload.php8.94 ▲5.7168.17 ▲29.90
Role and Customer Based Pricing for WooCommerce /wp-admin/admin.php?page=role-and-customer-based-pricing-for-woocommerce8.9463.65
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9459.31

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 283 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_recent-comments
fs_debug_mode
widget_theysaidso_widget
widget_recent-posts
fs_active_plugins
theysaidso_admin_options
db_upgraded
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Role Based Pricing by Meow Crew
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6314.25 ▲0.001.47 ▼0.2729.49 ▼14.33
Dashboard /wp-admin2,212 ▲315.52 ▼0.0696.95 ▼20.8848.92 ▲1.18
Posts /wp-admin/edit.php2,124 ▲242.09 ▲0.1445.11 ▲8.2340.35 ▲5.29
Add New Post /wp-admin/post-new.php1,534 ▲823.05 ▼0.04671.50 ▼116.4549.65 ▼12.59
Media Library /wp-admin/upload.php1,420 ▲204.17 ▼0.0599.49 ▼6.6545.72 ▲4.40
Role and Customer Based Pricing for WooCommerce /wp-admin/admin.php?page=role-and-customer-based-pricing-for-woocommerce9761.6628.5560.72
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0851.6526.4729.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_debug_mode
    • db_upgraded
    • fs_accounts
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MeowCrew\\RoleAndCustomerBasedPricing\\Settings\\Sections\\AbstractSection' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Settings/Sections/ImportExportSection.php:7
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Settings/CustomOptions/TemplateOption.php on line 6
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/RoleManagement/RoleManagementPage.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'MeowCrew\\RoleAndCustomerBasedPricing\\Settings\\Sections\\AbstractSection' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Settings/Sections/PricingSection.php:7
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Services/NonLoggedUsersService.php on line 5
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Settings/Sections/AbstractSection.php on line 5
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Admin/ProductPage/RoleSpecificPricingTab.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'MeowCrew\\RoleAndCustomerBasedPricing\\Entity\\PricingRule' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/Entity/GlobalPricingRule.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MeowCrew\\RoleAndCustomerBasedPricing\\RoleManagement\\Actions\\RoleManagementPageAction' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/RoleManagement/Actions/NewRoleAction.php:5
    • > PHP Fatal error
      Trait 'MeowCrew\\RoleAndCustomerBasedPricing\\Core\\ServiceContainerTrait' not found in wp-content/plugins/role-and-customer-based-pricing-for-woocommerce/src/GlobalRoleSpecificPricing/CPT/Actions/SuspendAction.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: wholesale, woocommerce, role based pricing, dynamic price, prices by user role

role-and-customer-based-pricing-for-woocommerce/role-and-customer-based-pricing-for-woocommerce.php 92% from 13 tests

The main file in "WooCommerce Role Based Pricing by Meow Crew" v. 1.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.2" instead of "5.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected43,693 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP1929,65318,26938,084
PO File121,7992,2384,813
CSS148117396
JavaScript59659379
XML13016
JSON1005

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity49.46
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces21
Interfaces1
Traits1
Classes103
▷ Abstract classes43.88%
▷ Concrete classes9996.12%
▷ Final classes00.00%
Methods1,573
▷ Static methods23615.00%
▷ Public methods1,16373.94%
▷ Protected methods211.34%
▷ Private methods38924.73%
Functions156
▷ Named functions10265.38%
▷ Anonymous functions5434.62%
Constants171
▷ Global constants9957.89%
▷ Class constants7242.11%
▷ Public constants72100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/role-and-customer-based-pricing-for-woocommerce.png38.00KB9.52KB▼ 74.96%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%