Title: Constant WP_PLUGIN_DIR already defined
Last modified: March 2, 2021

---

# Constant WP_PLUGIN_DIR already defined

 *  [axlright](https://wordpress.org/support/users/axlright/)
 * (@axlright)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/constant-wp_plugin_dir-already-defined/)
 * Great looking plugin!
 * I’m using this with Local / Flywheel, so the command I used to get it running
   is `ngrok http -host-header=local-site.org 443`
 * When running either the http or https ngrok link, the site does somewhat load
   with this warning:
 * > Notice: Constant WP_PLUGIN_DIR already defined in /Users/alexwright/Sites/level/
   > app/public/wp-content/plugins/wp-ngrok/core.php on line 106
 * The site somewhat loads the parent theme but not much of anything beyond that.
 * Happy to send any other ngrok inspect details.
    -  This topic was modified 5 years, 3 months ago by [axlright](https://wordpress.org/support/users/axlright/).

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

 *  [overtureweb](https://wordpress.org/support/users/overtureweb/)
 * (@overtureweb)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/constant-wp_plugin_dir-already-defined/#post-14280210)
 * The constant WP_PLUGIN_DIR is already defined in /wp-includes/default-constants.
   php. A constant can only be defined once so PHP throws a warning. If you’re comfortable
   working in source code go to the plugin file /wp-content/plugins/wp-ngrok/core.
   php and modify line 106 to include a test for the presence of the constant:
 * change :
 * `define( 'WP_PLUGIN_DIR', $server_proto . $_SERVER['HTTP_HOST'] );`
    to:
 *     ```
       if (!defined('WP_PLUGIN_DIR')) {
       		            define( 'WP_PLUGIN_DIR', $server_proto . $_SERVER['HTTP_HOST'] );
       	            }
       ```
   
 * The only problem with this fix is that if the plugin is updated the change will
   probably be overwritten. Hopefully the developer sees this and applies a fix.
    -  This reply was modified 5 years, 2 months ago by [overtureweb](https://wordpress.org/support/users/overtureweb/).
    -  This reply was modified 5 years, 2 months ago by [overtureweb](https://wordpress.org/support/users/overtureweb/).
    -  This reply was modified 5 years, 2 months ago by [overtureweb](https://wordpress.org/support/users/overtureweb/).
 *  Plugin Author [Theme.id](https://wordpress.org/support/users/themeid/)
 * (@themeid)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/constant-wp_plugin_dir-already-defined/#post-14310034)
 * [@axlright](https://wordpress.org/support/users/axlright/) Thank you for your
   feedback.
    and thank to [@overtureweb](https://wordpress.org/support/users/overtureweb/)
   for your suggest. we’ll update

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

The topic ‘Constant WP_PLUGIN_DIR already defined’ is closed to new replies.

 * ![](https://ps.w.org/wp-ngrok/assets/icon.svg?rev=2430738)
 * [WP-ngrok](https://wordpress.org/plugins/wp-ngrok/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ngrok/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ngrok/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ngrok/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ngrok/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Theme.id](https://wordpress.org/support/users/themeid/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/constant-wp_plugin_dir-already-defined/#post-14310034)
 * Status: not resolved