Support » Plugin: Custom Products for WooCommerce » Error after update

  • The plugin is showing error after the last update:

    Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in /home1/comprasmogi/public_html/wp-includes/capabilities.php:660 Stack trace: #0 /home1/comprasmogi/public_html/wp-content/plugins/custom-products-for-woocommerce/includes/class-woocp.php(835): current_user_can(‘manage_woocomme…’) #1 /home1/comprasmogi/public_html/wp-content/plugins/custom-products-for-woocommerce/includes/class-woocp.php(544): WOOCP->woocp_check_perms() #2 /home1/comprasmogi/public_html/wp-includes/class-wp-hook.php(287): WOOCP->woocp_sort_products_by_customizable(Object(WP_Query)) #3 /home1/comprasmogi/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array) #4 /home1/comprasmogi/public_html/wp-includes/plugin.php(544): WP_Hook->do_action(Array) #5 /home1/comprasmogi/public_html/wp-includes/class-wp-query.php(1768): do_action_ref_array(‘pre_get_posts’, Array) #6 /home1/comprasmogi/public_html/wp-includes/class-wp-query.php(3432): WP_Query->get_posts() #7 /home1/comprasmogi/public_html/wp-includes/p in /home1/comprasmogi/public_html/wp-includes/capabilities.php on line 660

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Grega Radelj

    (@grrega)

    Hi @bomelindo.

    I just tested the plugin on a fresh install and I get no such errors. The last update was a minor fix and had nothing to do with the function that your error indicates is the problem. That functionality has been there from the start and was not modified in the last update.

    Your error suggests that the problem happens when you order your products by “Is customizable” – do you have any other plugins installed that have any effect on the ordering of products on the “Products” page?

    Can you let me know what versions of WordPress, WooCommerce and PHP you’re using?

    Thread Starter bomelindo

    (@bomelindo)

    Thank you for your reply.

    No, I was just using your plugin to customize products. But, I tried install another version, and the error remains.

    WordPress and Woocommerce are in the last versions, 5.4.2 and 4.3.0
    respectively, and PHP in 7.1.3

    Plugin Author Grega Radelj

    (@grrega)

    I did some more testing and I can’t trigger the same error no matter what I try. The function that your error suggests is “undefined” is included in WordPress core. And like I mentioned – it’s been in my plugin since version 1.0.0. It’s used in a lot of other places, so this error really doesn’t make much sense to me…

    Did you recently update you WordPress install? Can you try a re-install? Do you use any plugins that alter user permissions?

    I’ve added a check if that function exists in my plugin, so at least it shouldn’t crash your site. I will release an update today or tomorrow at the latest. If the problem persist I will have to ask you to contact me on info@grrega.com. If I can’t help you here I will need a backup of your site (or admin access so I can create and download a backup myself) which I can restore locally on my computer to test what the problem is.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error after update’ is closed to new replies.