Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DOKAN_LITE_SINCE with corresponding versions #2567

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

Aunshon
Copy link
Collaborator

@Aunshon Aunshon commented Feb 12, 2025

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Replace DOKAN_PRO_SINCE with corresponding versions.

Related Pull Request(s)

Closes

How to test the changes in this Pull Request:

  • 🚫No test needed

Changelog entry

  • 🚫No change log needed

Summary by CodeRabbit

  • Documentation
    • Updated internal version annotations across the platform to reflect specific release numbers, ensuring improved consistency and clarity.
    • These enhancements are purely internal and do not change the functionality or user experience.

Copy link
Contributor

coderabbitai bot commented Feb 12, 2025

Walkthrough

The pull request updates versioning annotations across the codebase by replacing generic placeholders (e.g., DOKAN_PRO_SINCE, DOKAN_LITE_SINCE) with specific version numbers. In addition, several methods in the Commission class have been deprecated and restructured, and a minor logic correction has been applied to withdrawal limit validation. Other changes include improved error handling in stock updates and new hooks/methods in order management to support HPOS. All changes are confined to documentation and minor non‐functional adjustments.

Changes

File(s) Change Summary
assets/src/js/helper.js Updated version tags for various helper functions (dokan_get_i18n_time_format, dokan_get_formatted_time, dokan_sweetalert, dokan_get_i18n_date_format) to specific versions (e.g., 3.3.7, 3.2.13, 3.2.7).
includes/Abstracts/…Controller.php Updated class and method docblocks in REST controllers (DokanRESTBaseController, DokanRESTCustomerController, DokanRESTVendorController) from DOKAN_PRO_SINCE to 3.14.4.
includes/Admin/Settings.php Updated documentation annotations for admin settings methods; fixed logic in set_withdraw_limit_value_validation.
includes/BackgroundProcess/… Updated @since annotations for Manager and RewriteVariableProductsAuthor from DOKAN_LITE_SINCE to 3.7.10.
includes/Commission.php
includes/Commission/Upugrader/…
Deprecated several commission calculation methods and updated version annotations (e.g., to 3.14.0 and 3.14.9).
includes/Dashboard/Templates/Settings.php Updated is_seller_connected method’s annotation from DOKAN_PRO_SINCE to 3.5.1.
includes/Emails/… Updated versioning for email classes (e.g., ContactSeller to 3.2.15 and VendorCompletedOrder to 3.2.2).
includes/Fees.php Updated get_processing_fee annotation to 3.0.4 and migrated several methods from the commission module.
includes/Order/Admin/Hooks.php Introduced new methods (admin_on_delete_order_post, admin_on_delete_order), added conditional hook registrations based on HPOS, and enhanced error handling (e.g., in admin_on_untrash_order) with version annotation updated to 3.8.0.
includes/Product/Hooks.php
includes/Product/functions.php
Updated version annotations for product hooks and catalog ordering functions to 3.8.2 and 3.2.7 respectively.
includes/ProductStatusRollback.php Updated annotations to 3.14.9.
includes/REST/… Updated version annotations for REST controllers (AdminDashboardController to 3.0.10; StoreSettingController to 3.2.12).
includes/Rewrites.php Updated version annotations for product sorting and joining methods to 3.2.7.
includes/ThemeSupport/Divi.php Set set_current_page annotation to 3.0.5.
includes/Upgrade/Upgrades/… Updated version annotations in multiple upgrade scripts (e.g., to 3.0.10, 3.1.1, 3.0.4, 3.7.10).
includes/Vendor/UserSwitch.php Updated user switching annotations to 3.0.6.
includes/Widgets/FilterByAttributes.php Updated widget action hooks annotation to 3.5.0.
includes/Withdraw/… Updated withdraw-related methods (get_total_withdraw_count, get_details, set_details) to 3.2.0 and 3.2.12.
includes/functions-dashboard-navigation.php
includes/functions.php
includes/store-functions.php
Updated various function annotations (e.g., dokan_dashboard_nav to 3.10.0, dokan_count_stock_posts to 3.2.5, etc.).
includes/wc-functions.php Added error handling and additional checks for stock updates in the dokan_process_product_meta function.
templates/emails/…
templates/products/…
templates/settings/payment-manage.php
Updated version annotations in email templates, product hooks, and payment settings comments (e.g., to 3.2.2, 3.13.1, and 3.4.3 respectively).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant OrderHooks
    participant Database
    User->>OrderHooks: Request deletion of an order post
    OrderHooks->>OrderHooks: Evaluate HPOS condition
    OrderHooks->>Database: Invoke admin_on_delete_order_post (delete sub-orders)
    Database-->>OrderHooks: Confirm sub-orders deletion
    OrderHooks->>Database: Call admin_on_delete_order (delete main order)
    Database-->>OrderHooks: Confirm order deletion
    OrderHooks->>User: Return deletion confirmation
Loading

Suggested labels

QA approved, :+1: Dev Review Done, Upcoming Release

Suggested reviewers

  • mrabbani

Poem

I’m a rabbit hopping through lines of code,
Updating version tags on a grand old road.
Deprecated methods quietly take their leave,
While new hooks and fixes help us achieve.
I nibble on bugs, then happily dash away—
Celebrating these changes in a bouncy display!
🐇💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60f44e4 and 1272dc9.

📒 Files selected for processing (40)
  • assets/src/js/helper.js (3 hunks)
  • includes/Abstracts/DokanRESTBaseController.php (2 hunks)
  • includes/Abstracts/DokanRESTCustomerController.php (2 hunks)
  • includes/Abstracts/DokanRESTVendorController.php (2 hunks)
  • includes/Admin/Settings.php (2 hunks)
  • includes/BackgroundProcess/Manager.php (4 hunks)
  • includes/BackgroundProcess/RewriteVariableProductsAuthor.php (5 hunks)
  • includes/Commission.php (2 hunks)
  • includes/Commission/Upugrader/Update_Category_Commission.php (7 hunks)
  • includes/Commission/Upugrader/Update_Product_Commission.php (8 hunks)
  • includes/Commission/Upugrader/Update_Vendor_Commission.php (8 hunks)
  • includes/Dashboard/Templates/Settings.php (2 hunks)
  • includes/Emails/ContactSeller.php (1 hunks)
  • includes/Emails/VendorCompletedOrder.php (3 hunks)
  • includes/Fees.php (1 hunks)
  • includes/Order/Admin/Hooks.php (2 hunks)
  • includes/Product/Hooks.php (2 hunks)
  • includes/Product/functions.php (1 hunks)
  • includes/ProductStatusRollback.php (6 hunks)
  • includes/REST/AdminDashboardController.php (1 hunks)
  • includes/REST/StoreSettingController.php (1 hunks)
  • includes/Rewrites.php (6 hunks)
  • includes/ThemeSupport/Divi.php (1 hunks)
  • includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php (3 hunks)
  • includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php (2 hunks)
  • includes/Upgrade/Upgrades/V_3_0_4.php (2 hunks)
  • includes/Upgrade/Upgrades/V_3_7_10.php (1 hunks)
  • includes/Vendor/UserSwitch.php (5 hunks)
  • includes/Widgets/FilterByAttributes.php (4 hunks)
  • includes/Withdraw/Manager.php (1 hunks)
  • includes/Withdraw/Withdraw.php (2 hunks)
  • includes/functions-dashboard-navigation.php (1 hunks)
  • includes/functions.php (4 hunks)
  • includes/store-functions.php (1 hunks)
  • includes/wc-functions.php (4 hunks)
  • templates/emails/plain/vendor-completed-order.php (1 hunks)
  • templates/emails/vendor-completed-order.php (1 hunks)
  • templates/products/edit-product-single.php (2 hunks)
  • templates/products/products-listing-row.php (1 hunks)
  • templates/settings/payment-manage.php (1 hunks)
✅ Files skipped from review due to trivial changes (36)
  • includes/Withdraw/Manager.php
  • includes/store-functions.php
  • templates/emails/plain/vendor-completed-order.php
  • templates/settings/payment-manage.php
  • includes/REST/AdminDashboardController.php
  • includes/Withdraw/Withdraw.php
  • includes/Abstracts/DokanRESTCustomerController.php
  • includes/Upgrade/Upgrades/V_3_0_4.php
  • includes/Product/Hooks.php
  • includes/ProductStatusRollback.php
  • templates/products/products-listing-row.php
  • templates/emails/vendor-completed-order.php
  • includes/Widgets/FilterByAttributes.php
  • includes/ThemeSupport/Divi.php
  • includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php
  • includes/Product/functions.php
  • includes/Emails/ContactSeller.php
  • includes/Abstracts/DokanRESTVendorController.php
  • includes/functions-dashboard-navigation.php
  • includes/Upgrade/Upgrades/V_3_7_10.php
  • includes/Abstracts/DokanRESTBaseController.php
  • includes/REST/StoreSettingController.php
  • includes/BackgroundProcess/RewriteVariableProductsAuthor.php
  • templates/products/edit-product-single.php
  • includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php
  • includes/Dashboard/Templates/Settings.php
  • includes/Fees.php
  • includes/Emails/VendorCompletedOrder.php
  • assets/src/js/helper.js
  • includes/BackgroundProcess/Manager.php
  • includes/Rewrites.php
  • includes/Commission/Upugrader/Update_Product_Commission.php
  • includes/Vendor/UserSwitch.php
  • includes/Commission/Upugrader/Update_Vendor_Commission.php
  • includes/Commission/Upugrader/Update_Category_Commission.php
  • includes/functions.php
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: e2e tests (3, 3)
  • GitHub Check: e2e tests (2, 3)
  • GitHub Check: e2e tests (1, 3)
  • GitHub Check: api tests (1, 1)
🔇 Additional comments (10)
includes/Admin/Settings.php (2)

985-985: LGTM! Documentation update.

The version number update in the @since tag provides more precise versioning information.


1000-1000: LGTM! Documentation update.

The version number update in the @since tag provides more precise versioning information.

includes/Commission.php (2)

455-455: DocBlock version alignment looks good.
No functional changes; the updated @since tag clarifies version history.


470-470: DocBlock version alignment looks good.
No functional changes; the updated @since tag clarifies version history.

includes/Order/Admin/Hooks.php (2)

385-385: DocBlock updated to reflect correct version.
The versioning annotation is consistent and clarifies the method’s introduction.


455-455: DocBlock version alignment looks good.
No functional changes; the updated @since tag clarifies version history.

includes/wc-functions.php (4)

305-305: Stock management logic update noted.
Storing _manage_stock appears consistent with WooCommerce’s approach.


315-315: Comment adds clarity to stock handling.
The note on retrieving original stock value improves maintainability.


329-329: Comment improves readability.
Emphasizing that _low_stock_amount is updated independently helps future maintainers.


942-942: Filter documentation updated.
Mentioning the version and filter name aligns with best practices for doc clarity.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mrabbani mrabbani merged commit 1658a61 into develop Feb 13, 2025
5 of 6 checks passed
@mrabbani mrabbani deleted the enhance/replace-dokan-lite-since-and-others branch February 13, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants