-
Notifications
You must be signed in to change notification settings - Fork 48
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
Numbers tab exhausting memory limit #752
Comments
System report for my site, if it helps:- ` WordPress EnvironmentWordPress address (URL): https://myeliquidsupplies.com Server EnvironmentServer Info: Apache/2.4.58 SUHOSIN Installed: – DatabaseWC Database Version: 8.6.1 Post Type Countsattachment: 825 SecuritySecure connection (HTTPS): ✔ Active Plugins (40)Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.1 Code Snippets: by Code Snippets Pro – 3.6.4 Trustpilot-reviews: by Trustpilot – 2.5.925 User Role Editor: by Vladimir Garagulya – 4.64.2 Inactive Plugins (0)Dropin Plugins (1)advanced-cache.php: advanced-cache.php SettingsAPI Enabled: – Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) Connected to Woo.com: – WC PagesShop base: #15 - /shop/ ThemeName: Woodmart Child TemplatesOverrides: woodmart/woocommerce/archive-product.php AdminEnabled Features: activity-panels Disabled Features: customize-store Daily Cron: ✔ Next scheduled: 2024-03-19 00:19:12 +00:00 Action SchedulerComplete: 44,877 Pending: 719 Store CreditPrices entered with tax: yes Status report informationGenerated at: 2024-03-18 16:28:10 +00:00 |
This seems a bit quicker: // add document title or 'Deleted'
if ( ! empty( $results ) && ! empty( $document_type ) ) {
$document_titles = WPO_WCPDF()->documents->get_document_titles();
foreach ( $results as $key => $result ) {
$result = (array) $result;
$document_types = array( $document_type );
$order_id = isset( $result['order_id'] ) ? absint( $result['order_id'] ) : 0;
if ( 0 === $order_id ) {
continue;
}
$order = wc_get_order( $order_id );
if ( empty( $order ) ) {
continue;
}
if ( 'invoice' === $document_type && ! empty( $invoice_number_store_doc_types ) ) {
$document_types = array_merge( $document_types, $invoice_number_store_doc_types );
}
foreach ( $document_types as $doc_type ) {
$meta_number = $order->get_meta( '_wcpdf_'.$doc_type.'_number', true );
if ( ! empty( $meta_number ) && isset( $result['id'] ) && absint( $result['id'] ) === absint( $meta_number ) ) {
$results[ $key ]->document_title = $document_titles[ $doc_type ];
}
}
}
} But I think we should limit the number of recent orders with an input. |
A customer reported issues when trying to load the Numbers tab. Note that this user has 26k orders, which might be the reason for the memory exhausting issue.
The text was updated successfully, but these errors were encountered: