Support » Plugin: WP Customer Reviews » out of memory using this plugin with custom post types

  • Resolved laz0rama

    (@laz0rama)


    wordpress 4.9.4
    wp-customer-reviews 3.1.5
    custom theme

    when this plugin is activated, the front end of the site is fine – however when i attempt to access wp-admin, i get an out of memory error:

    Fatal error: Allowed memory size of 786432000 bytes exhausted (tried to allocate 72 bytes) in <snip>/wp-includes/taxonomy.php on line 1438

    there are about 90,000 posts, and they are all of 2 different custom post types. as you can see, i have 750M allocated to php, plenty.

    i disabled all other plugins, and i discovered that the error occurs when i enable the plugin that creates the custom post types. that is literally all that plugin does, and the code that creates the post types is pasted below. obviously, i cannot get rid of the plugin that creates the post types, as that prevents me from accessing the custom post types at all through wp-admin.

    i should mention that with only a few posts (including the custom post types), there is no error.

    is this some known issue? has anyone else seen this? is it not possible to have more than a few posts (of custom post types) with this plugin? i am stumped as to what to do, since this is the only reviews plugin that works for us on the front end. i even tried v2 of the plugin, which did not barf with a memory error, but also did not display the reviews on the front end (which is the problem with most of the other reviews plugins i tried, as well).

    any ideas?

    function create_post_types()
    {
    register_post_type( ‘bank’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Banks’ ),
    ‘singular_name’ => __( ‘Bank’ )
    ),
    ‘description’ => __(‘Bank Posts represent a single bank within a given city’),
    ‘public’ => true,
    ‘has_archive’ => false,
    “sptp_permalink_structure” => “/%category%/%postname%/”,
    ‘menu_position’ => 5,
    ‘hierarchical’ => false,
    ‘supports’ => array(‘title’, ‘editor’, ‘author’, ‘trackbacks’, ‘custom_fields’, ‘comments’),
    ‘taxonomies’ => array(‘category’, ‘post_tag’),
    )
    );
    register_post_type( ‘city’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Cities’ ),
    ‘singular_name’ => __( ‘City’ )
    ),
    ‘description’ => __(‘City Posts represent a single city within a given state’),
    ‘public’ => true,
    ‘has_archive’ => false,
    “sptp_permalink_structure” => “/%category%/%postname%/”,
    ‘menu_position’ => 5,
    ‘hierarchical’ => false,
    ‘supports’ => array(‘title’, ‘editor’, ‘author’, ‘trackbacks’, ‘custom_fields’, ‘comments’),
    ‘taxonomies’ => array(‘category’, ‘post_tag’),
    )
    );
    }

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Aaron Queen

    (@bompus)

    Interesting.. I’ll see if I can recreate on my end.

    Can you verify this happens simply be trying to access any page in wp-admin, or a specific set of pages?

    thanks for quick response!

    the only page i can try it on is the plugins page, because as soon as i try to activate either wp-customer-reviews OR my plugin that creates the custom post types, i get the memory error. activating either one without the other works fine.

    Plugin Author Aaron Queen

    (@bompus)

    Alright. I’ll try to test the same conditions this evening to see what I find. Hopefully I can find and fix it for everybody if it’s an issue with my plugin.

    Plugin Author Aaron Queen

    (@bompus)

    Do you by chance have all 90k of those custom posts, or many of them, enabled for reviews. If you open them up, is the checkbox checked that says to enable WP Customer Reviews for the posts?

    i can’t open them up in admin because remember, i cannot get to the admin pages when the reviews plugin is activated.

    but all the posts are imported by a script, and that script adds the several rows in the postmeta table that do enable the plugin. that was working fine, because when there was a small number of posts imported, i tested it and the plugin was in fact enabled for all the posts imported. it is only after they were all imported that the error started occurring.

    Plugin Author Aaron Queen

    (@bompus)

    That’s what I had hoped you would say, since that is the only case I found which would cause this behavior. I’ve identified a huge performance issue for blogs with many posts, and have a fix in place to allow the blog to function at full speed again.

    However, I still need to make some adjustments to the Reviews listing page in admin, and the review editing form in admin. Currently, they output a dropdown box with the title of every review-enabled post. With 90k posts, this will probably crash your browser, or at best, load very slow and slow the page down. I’m looking at turning this into a select2 powered dropdown, so that it doesn’t need to load the full dataset. Hopefully I can finish up on that this evening and get a new version out for you.

    much appreciated

    Plugin Author Aaron Queen

    (@bompus)

    Alright. Try out 3.1.6 , released seconds ago 🙂 and let me know how it goes. I have high hopes!

    thank you so much aaron. but i have hit upon a separate issue – related to wordpress urls/permalinks/404s – that may actually prevent me from using wordpress on that particular site. once i resolve that issue i will be able to test out your new release. i do really appreciate your response and effort.

    Plugin Author Aaron Queen

    (@bompus)

    I made some additional performance improvements in 3.2.0 if you wanted to give it a shot still.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘out of memory using this plugin with custom post types’ is closed to new replies.