Fatal error: Out of memory
-
when i enable plugin and run it this error show
https://pasteboard.co/JdE88T2.jpgThe number of my products is about 8000.
-
This topic was modified 4 years, 9 months ago by
shimist.
-
This topic was modified 4 years, 9 months ago by
-
One solution is to limit the amount of data being processed by creating a custom view. You can customize your view by starting with the Standard Columns and then copying the View to give it a name:
You can customize your view by starting with the Standard Columns and then copying the View to give it a name:
1. Filter the products and select “Standard Columns” from the View dropdown menu.
2. Once you have the Standard Columns view selected, click on the Copy View button.
3. You will be prompted to provide a name for your new custom view. After you click OK, you can add any columns you want to see by clicking the “Edit View” button.
4. Click on the columns you want to show in the grid.
5. The server will now return less data since you have selected fewer columns.For me, this error occurs when I run the plugin and the plugin settings section does not open. As a result of the solutions you mentioned I can’t access.
If possible, give me a code to put in the function or wp-config to fix this problem
-
This reply was modified 4 years, 9 months ago by
shimist.
You can specify only the fields you need to see/edit on the server-side and that reduces the memory needs. Follow these instructions to only return certain columns. An alternative to using FTP would be to use the free Code Snippets plugin: https://www.ads-software.com/plugins/code-snippets/
1. Download the free Code Snippets plugin and create a Snippet with the following code. If you are more comfortable editing your functions.php file you can do that instead.
function pw_bulk_edit_custom_columns( $columns ) { // List each field that you want to edit and see. This is case sensitive. $show_columns = array( __( 'Product name', 'woocommerce' ), __( 'Type', 'woocommerce' ), __( 'Status', 'woocommerce' ), __( 'Regular price', 'woocommerce' ), __( 'Sale price', 'woocommerce' ), __( 'Sale start date', 'woocommerce' ), __( 'Sale end date', 'woocommerce' ), __( 'Stock status', 'woocommerce' ), __( 'Stock quantity', 'woocommerce' ), __( 'SKU', 'woocommerce' ), __( 'Categories', 'woocommerce' ), __( 'ID', 'woocommerce' ), ); $filtered_columns = array(); foreach ( $columns as $column ) { if ( in_array( $column['name'], $show_columns ) ) { $filtered_columns[] = $column; } } return $filtered_columns; } add_filter( 'pwbe_product_columns', 'pw_bulk_edit_custom_columns', 99, 1 );
Add any columns you would like to see to the list (be sure to include the single-quotes and trailing comma).
I use this code in my Function.php
But again, when open the plugin, the same error occursfunction pw_bulk_edit_custom_columns( $columns ) {
// List each field that you want to edit and see. This is case sensitive.
$show_columns = array(
__( ‘Product name’, ‘woocommerce’ ),
__( ‘Type’, ‘woocommerce’ ),
__( ‘Status’, ‘woocommerce’ ),
__( ‘Regular price’, ‘woocommerce’ ),
__( ‘Categories’, ‘woocommerce’ ),
__( ‘ID’, ‘woocommerce’ ),
);$filtered_columns = array();
foreach ( $columns as $column ) {
if ( in_array( $column[‘name’], $show_columns ) ) {
$filtered_columns[] = $column;
}
}return $filtered_columns;
}
add_filter( ‘pwbe_product_columns’, ‘pw_bulk_edit_custom_columns’, 99, 1 );Another possibility is that you have a large number of Attributes that are being loaded. To prevent any Attributes from being shown in the Bulk Editor, try this code:
function custom_pwbe_attributes( $attributes ) { $attributes = array(); return $attributes; } add_filter( 'pwbe_attributes', 'custom_pwbe_attributes' );
This will prevent any attributes from being shown. If it works and you need to show some attributes, use this code instead so you can specify which attributes you need to see:
function custom_pwbe_attributes( $attributes ) { $attributes = array( array( 'slug' => 'pa_color', 'name' => 'Color' ), array( 'slug' => 'pa_size', 'name' => 'Size' ), ); return $attributes; } add_filter( 'pwbe_attributes', 'custom_pwbe_attributes' );
Specify the attribute slug and name where appropriate. You can find the slug inside your WordPress Admin area under Products -> Attributes (just prefix with “pa_”)
Incidentally, I did not define any attributes for my products
https://pasteboard.co/JdLSEG0.jpg
The problem is that the plugin settings page is not displayed for me And an error occurs
-
This reply was modified 4 years, 9 months ago by
shimist.
Unfortunately I don’t know what else to try. It looks like our plugin won’t be compatible with your site, sorry.
the code in meta.php on line 964
// Add a value to the current pid/key.
$cache[ $mpid ][ $mkey ][] = $mval;
}
}foreach ( $ids as $id ) {
if ( ! isset( $cache[ $id ] ) ) {
$cache[ $id ] = array();
}
wp_cache_add( $id, $cache[ $id ], $cache_key );
}return $cache;
}and the code of class-wp-fatal-error-handler on line 64
protected function detect_error() {
$error = error_get_last();// No error, just skip the error handling code.
if ( null === $error ) {
return null;
}What restrictions might these codes have on my site’s server?
What is your solution to this problem?
Is there a way for me to get the export postmeta table and edit it with your plugin on the local and re-import it?
Help me if you canThat is code from the WordPress core and isn’t something that should be changed. Unfortunately unless your website host allocates more resources you won’t be able to use our plugin and will need to find another to accomplish the task.
I’m marking this thread as resolved, best of luck with your store!
What are the minimum resources to run your plugin?
The question for me is why the plugin does not run
Because the editing operation on the products has not been done yet, the plugin should not give an error-
This reply was modified 4 years, 9 months ago by
shimist.
There isn’t a set minimum resource, it depends on the amount of data.
You could enable logging to see if there is any additional information about the out of memory error.
1. Log into your FTP site and edit wp-config.php
2. Set the following values (add the lines if they don’t exist):define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 );
3. Return to the site and trigger the error again.
4. Now go back to FTP and send me the file /wp-content/debug.log
5. Return to wp-config.php and set DEBUG back to false (reverting the changes made in Step 2) -
This reply was modified 4 years, 9 months ago by
- The topic ‘Fatal error: Out of memory’ is closed to new replies.