Title: Error when activating plugin
Last modified: August 30, 2016

---

# Error when activating plugin

 *  [alesmenzel](https://wordpress.org/support/users/alesmenzel/)
 * (@alesmenzel)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/)
 * Hello i installed your plugin, but i get the same error as in the topis “Error
   with woocommerce 2.3.9”, but iam unable to fix it. Can you help me?
 * Notice: Undefined property: WC_PaymentGateway_Add_extra_std_Charges::$plugin_url
   in …/wp-content/plugins/woocommerce-extra-charges-to-payment-gateways/woocommerce-
   extra-charges-option-to-payment-gateways-std.php on line 151
 * Notice: wp_enqueue_script 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.) in …/wp-includes/functions.php on line
   3560
 * [https://wordpress.org/plugins/woocommerce-extra-charges-to-payment-gateways/](https://wordpress.org/plugins/woocommerce-extra-charges-to-payment-gateways/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [hemsingh1](https://wordpress.org/support/users/hemsingh1/)
 * (@hemsingh1)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706120)
 * Hi,
 * These are just warning messages & not errors. You will need to upgrade to latest
   woocommerce (2.4.10) and turn off debugging in wp-config.php.
 * Thanks
 *  [helldog2004](https://wordpress.org/support/users/helldog2004/)
 * (@helldog2004)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706147)
 * I installed the same plugin on my local WordPress environment with the same error.
   I also updated my WooCommerce to version 2.5.5
 * Request a fix for this please, updating stuff that does not fix and hiding bugs
   are not realy helpful.
 *  [helldog2004](https://wordpress.org/support/users/helldog2004/)
 * (@helldog2004)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706148)
 * Also this error is being thrown out by your plug-in:
 * `Notice: wp_enqueue_script 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.) in D:\xampp\htdocs\piaffe\wp-includes\
   functions.php on line 3792`
 * This notice was shown after activating this plug-in.
    Thanks.
 *  [helldog2004](https://wordpress.org/support/users/helldog2004/)
 * (@helldog2004)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706149)
 * Okay the following solution worked for me, its a bit of a work-around but workable.
 * remove line 41 from woocommerce-extra-charges-option-to-payment-std.php or comment
   it out with //
    Then add the following code inside your themes functions.php
 *     ```
       function extra_charge(){
       	wp_register_script('app12', 'http://www.localhost/piaffe/wp-content/woocommerce-extra-charges-to-payment-gateways/assets/app.js', array( 'jquery' ));
       	wp_enqueue_script('app12');
       	}
   
       add_action( 'wp_enqueue_scripts', 'extra_charge' );
       ```
   
 * Of course, don’t forget to edit your own url.
    Let me know if this solves it 
   for ya.
 *  [helldog2004](https://wordpress.org/support/users/helldog2004/)
 * (@helldog2004)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706150)
 * Final solution for everyone who want to solve these messages:
 * Open up woocommerce-extra-charges-option-to-payment-gateways-std.php en comment
   out line
    `wp_enqueue_script( 'wc-add-extra-charges', $this->plugin_url() . '/
   assets/app.js', array('wc-checkout'), false, true );`
 * and add the following code above **class WC_PaymentGateway_Add_extra_std_Charges{**
 *     ```
       function __construct(){
       	$this -> current_gateway_title = '';
       	$this -> current_gateway_extra_charges = '';
       	add_action('admin_head', array($this, 'add_form_fields'));
           add_action( 'woocommerce_calculate_totals', array( $this, 'calculate_totals' ), 10, 1 );
       	wp_register_script('app12', $this->plugin_url() . '/assets/app.js', array( 'jquery' ));
       	wp_enqueue_script('app12');
       	}
       ```
   
 * Cheers

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error when activating plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-extra-charges-to-payment-
   gateways.svg)
 * [Extra Charges To Payment Gateway For WooCommerce (Standard)](https://wordpress.org/plugins/woocommerce-extra-charges-to-payment-gateways/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-extra-charges-to-payment-gateways/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-extra-charges-to-payment-gateways/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-extra-charges-to-payment-gateways/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-extra-charges-to-payment-gateways/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-extra-charges-to-payment-gateways/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [helldog2004](https://wordpress.org/support/users/helldog2004/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-21/#post-6706150)
 * Status: not resolved