-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix: updates main WCPDF class #15
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes involve updates to the Changes
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
dokan-invoice.php (2)
80-82
: LGTM! Consider updating the plugin name in the notice message.The dependency update from 'woocommerce_pdf_invoices' to 'wpo_wcpdf' is correct and consistent with the changes mentioned in the summary. This change likely reflects an update in the WooCommerce PDF Invoices plugin's naming convention.
Consider updating the plugin name in the notice message to match the new naming convention:
- 'notice' => sprintf( __( '<b>Dokan PDF Invoice </b> requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/">', '</a>' ), + 'notice' => sprintf( __( '<b>Dokan PDF Invoice </b> requires %sWPO WCPDF plugin%s to be installed & activated!' , 'dokan-invoice' ), '<a target="_blank" href="https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/">', '</a>' ),
Line range hint
339-350
: LGTM! Consider using consistent method calls for improved readability.The updates to the
get_order_id_parent_id
method are good improvements. They modernize the code to use newer WooCommerce methods, which enhances compatibility with recent WooCommerce versions.For consistency and improved readability, consider using the same method call style for both
get_id()
andget_parent_id()
:- $order_id = $order->get_id(); - $parent_id = $order->get_parent_id(); + $order_id = $order->get_id(); + $parent_id = $order->get_parent_id();This makes the code more uniform and easier to read.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- dokan-invoice.php (2 hunks)
🔇 Additional comments not posted (2)
dokan-invoice.php (2)
164-165
: LGTM! Class check updated correctly.The update to the class existence check from 'WooCommerce_PDF_Invoices' to 'WPO_WCPDF' is correct and consistent with the changes in the constructor. This ensures that the plugin's hooks are only initialized when the WPO WCPDF plugin is active.
Line range hint
1-365
: Overall, the changes in this file are well-implemented and necessary.The updates to the dependency checks and method implementations improve compatibility with newer versions of WooCommerce and the WPO WCPDF plugin. The code quality has been maintained, and in some cases improved. The minor suggestions provided in the review comments will further enhance consistency and clarity.
Summary by CodeRabbit