Support » Plugin: WC Fields Factory » v.2.0.0 update error

  • Resolved Anydog

    (@anydog)


    Hi,
    I updated the plugin to latest v.2.0.0 and I got blank page with this error:

    Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in \wp-includes\functions.php on line 4146

    Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in \wp-includes\functions.php on line 4146

    Fatal error: Call to undefined function WC() in \wp-content\plugins\wc-fields-factory\includes\wcff-product-fields.php on line 78

    Could you please look at it asap, and release update, as it crashes the site (backend and frontend) ?

    Thanks

    • This topic was modified 1 year, 11 months ago by  Anydog.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Saravana Kumar K

    (@mycholan)

    Hi download the wcff-product-fields.php.zip (from here) and replace it with your /wc-fields-factory/includes/wcff-product-fields.php

    Let me know if it is working.

    It was everything ok for me until I updated the WooCommerce Version. So it crashes and appears that error mentioned:

    Fatal error: Call to undefined function WC() in \wp-content\plugins\wc-fields-factory\includes\wcff-product-fields.php on line 78

    I have updated the file for the one you said and it just change the line:

    Fatal error: Call to undefined function WC() in wp-content/plugins/wc-fields-factory/includes/wcff-product-fields.php on line 82

    @mycholan – thanks for your fast replies.
    @luiseduardops confirms the same error.
    It seems like your need the check if WC is activated.
    Something is obviously related with registering and enqueuing styles, too …
    But you probably know that already … 🙂

    I’ll just wait for update, which will hopefully be soon … 😉

    Plugin Author Saravana Kumar K

    (@mycholan)

    Hi Version 2.0.1 released with fixes, please update.

    Hi,
    sorry, I didn’t check this … No, unfortunately the update (even latest 2.0.5) didn’t solve the issue.
    The moment I deactivate WooCommerce, I get this error:
    Fatal error: Uncaught Error: Call to undefined function WC() in ...\wp-content\plugins\wc-fields-factory\includes\wcff-product-fields.php:82

    You should add a method to check if WooCommerce is activated, in the beginning of method registerHooks() you might add WC activation check, something like this:

    public function registerHooks() {
    	if( ! class_exists( 'WC' ) ) {
    		add_action( 'admin_notices', array( $this ,'admin_notice') ); 
    	}else{
    		... the rest of method
    	}
    	
    }
    public function admin_notice() {
    	$class = "error updated settings-error notice is-dismissible";
    	$message = __( 'WooCommerce is deactivated or even not installed. WC Fields Factory is useless without WooCommerce - please re-activate WooCommerce or deactivate WC Fields Factory', 'wcff' );
    	echo "<div class=\"$class\"><p>$message</p></div>";
    }

    Please could you fix that asap … ? Big thanks.
    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘v.2.0.0 update error’ is closed to new replies.