Title: Hardcoded plugins folder path
Last modified: October 5, 2019

---

# Hardcoded plugins folder path

 *  [strarsis](https://wordpress.org/support/users/strarsis/)
 * (@strarsis)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/hardcoded-plugins-folder-path/)
 * [@phamtungpth](https://wordpress.org/support/users/phamtungpth/): WP Pipes uses
   the constant `OB_PATH_PLUGIN` for the path to the WordPress site plugins folder
   and is hardcoded to a specific path (`'wp-content' . DS . 'plugins' . DS`).
    
   However, the path can be indeed different, like on roots.io Bedrock WordPress
   sites, but on any WordPress site because the plugins folder path is configurable.
   This causes WP Pipes not to find any WP Pipes extensions from installed plugins.
 * The [`WP_PLUGIN_DIR`](https://codex.wordpress.org/Determining_Plugin_and_Content_Directories#Constants)
   constant can be used instead which always has the correct path for any WordPress
   site configuration.
 * So
    `define( 'OB_PATH_PLUGIN', ABSPATH . 'wp-content' . DS . 'plugins' . DS );`
   has to be replaced with `define( 'OB_PATH_PLUGIN', WP_PLUGIN_DIR );` Or `WP_PLUGIN_DIR`
   directly used instead of `OB_PATH_PLUGIN`.
    -  This topic was modified 6 years, 8 months ago by [strarsis](https://wordpress.org/support/users/strarsis/).

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

 *  Thread Starter [strarsis](https://wordpress.org/support/users/strarsis/)
 * (@strarsis)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/hardcoded-plugins-folder-path/#post-12001587)
 * Addendum: `WP_PLUGIN_DIR` can’t be directly used instead of `OB_PATH_PLUGIN` 
   anyway because a directory separator is expected at the end (`DS` constant).
 * New fix: Replace
    `define( 'OB_PATH_PLUGIN', ABSPATH . 'wp-content' . DS . 'plugins'.
   DS );` with `define( 'OB_PATH_PLUGIN', WP_PLUGIN_DIR . DS );`
 * Addendum 2: However, appending `DS` to `OB_PATH_PLUGIN` results in WP Pipes not
   finding the extensions. But omitting `DS` at the end results in a ‘File not found’
   error in `models/pipe.php` when adding the processor (Ajax response in Web Developer
   Tools Network Tab)…
    In `models/pipe.php` the `$path_plugin` is constructed without
   appending `DS` to OB_PATH_PLUGIN, so `OB_PATH_PLUGIN` is expected to have `DS`
   appended. But the extension discovery code apparently has issues with `DS` appended
   to `OB_PATH_PLUGIN` as the extensions (here processor) is not listed anymore.`
   $path_plugin = OB_PATH_PLUGIN . $name . DS . $name . '.php';` Also note that `
   $path_plugin` is also defined in the same way in `controllers/pipe.php`, so the
   fix has to be applied there, too.
    -  This reply was modified 6 years, 8 months ago by [strarsis](https://wordpress.org/support/users/strarsis/).
    -  This reply was modified 6 years, 8 months ago by [strarsis](https://wordpress.org/support/users/strarsis/).
    -  This reply was modified 6 years, 8 months ago by [strarsis](https://wordpress.org/support/users/strarsis/).
    -  This reply was modified 6 years, 8 months ago by [strarsis](https://wordpress.org/support/users/strarsis/).
 *  Thread Starter [strarsis](https://wordpress.org/support/users/strarsis/)
 * (@strarsis)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/hardcoded-plugins-folder-path/#post-12010933)
 * Addendum: And in `helpers/common.php`:
    Replace
 *     ```
       		if ( ! is_file( $xml_dir . DS . $file . '.xml' ) ) {
       			$xml_dir = OB_PATH_PLUGIN . $file;
       		}
       ```
   
 * with
 *     ```
       		if ( ! is_file( $xml_dir . DS . $file . '.xml' ) ) {
       			$xml_dir = OB_PATH_PLUGIN . DS . $file;
       		}
       ```
   
 * This makes the processor options show up.

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

The topic ‘Hardcoded plugins folder path’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-pipes_baebe7.svg)
 * [WP Pipes](https://wordpress.org/plugins/wp-pipes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-pipes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-pipes/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-pipes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-pipes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-pipes/reviews/)

## Tags

 * [configuration](https://wordpress.org/support/topic-tag/configuration/)
 * [constant](https://wordpress.org/support/topic-tag/constant/)
 * [find](https://wordpress.org/support/topic-tag/find/)
 * [folder](https://wordpress.org/support/topic-tag/folder/)
 * [path](https://wordpress.org/support/topic-tag/path/)

 * 2 replies
 * 1 participant
 * Last reply from: [strarsis](https://wordpress.org/support/users/strarsis/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/hardcoded-plugins-folder-path/#post-12010933)
 * Status: not a support question