My best guess would be:
if ( ! is_file( $dir = WPMU_PLUGIN_DIR . '/pluginb/pluginb.php' ) ) {
if ( ! is_file( $dir = WP_PLUGIN_DIR . '/pluginb/pluginb.php' ) )
$dir = null;
}
return $dir;
However, the danger here is still the assumption of the plugin’s “basename” – a well written plugin will still function even when its directory and/or main file has been renamed (for whatever reason).
Which goes back to my original comment – depending on which third-party plugin this is referring to, many authors define their own methods/constants to hold the plugin path – it would make sense to check for their existence & use these instead (if available).
Related Posts:
- How to get the path to the current theme?
- Use WP_Theme::scandir function to scan a plugin directory. Is there a way?
- How to use relative path with my plugins folders?
- Is there any way to allow a plugin to write over a previous version?
- Plugin path comes wrongly
- Plugin SVN folder structure
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- No Error Log File, no debug info
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Shortcode adding p and br tags
- Using AJAX in a plugin to submit form – REALLY confused
- Problems with localization
- Install and load additional plugins when running unit tests
- Having Problem On Getting WP Post Gallery Images URL
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- Properly licensing a plugin that uses Apache 2.0 licensed code
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- Can I dynamically create a link to my plugin settings/options page from my plugin description?
- How to load the plugin only when logged in?
- Self-hosted plugin update problems
- Saving data from block editor to the database
- Cannot search post by taxonomy
- Hook into theme-switching later than `setup_theme`
- Save image as featured image
- Will current_theme_supports return TRUE with a nonstandard add_theme_support?
- WP AJAX is not working, always returns 0
- Act on user meta updated, but only once
- get_pages Drop down list for selection of a page
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Hide plugin dashboard menu item for specific roles
- Display content from custom post without modifying the single template
- How do I add custom column to woocommerce cart?
- WordPress mode for emacs?
- Widget translation on my plugin
- Upload to a remote server using wp_remote_post
- how to add custom functionality after woocommerce place order button
- Problems with: manage_${post_type}_posts_columns
- Make WordPress cache permanent for some pages until edited
- Getting timestamp of activation plugin time
- conditionally load javascript & CSS for do_action() calls from plugin
- Function: Add link to / inside div
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- The plugin does not save data
- How do I create plugin or theme using MVC pattern?
- Create custom HTML/JS app inside page
- How to Get Current Custom Post Type Associated Taxonomy Term
- tinymce.get() returns error after ajax request
- Access bloginfo, get_option, and plugins_url from a non-core php file
- Upload multiple images and insert them into custom html code
- How to get a list of child ids for a named category?
- Plugin could not be activated because it triggered a fatal error, unexpected ‘[‘
- How to make the first commit on WordPress.org
- How best to handle database version dependence (from $wp_db_version)
- Associate multiple email addresses with the same user account, so they can log in with either
- How to grab query string from wp-content/uploads/.*
- Custom filter not working
- ajax working when function is on child theme but not in plugin page
- I need to refresh page to display wp_get_current_user() : why?
- What is the way to hook all wordpress email
- Configure WordPress to Generate Scheme-less Relative URLs
- Best way to distribute templates and code accross multiple wordpress sites?
- Adding Dynamic Stylesheet
- Modify code for functions.php with specific twitter user url and hashtags
- Metabox is not displaying
- Proper way to do a page view count on a page?
- Catching a GET parameter from the URL and save it in the user meta when a user registers
- WP_Query not ordering correctly
- Custom User Role Preview Function Not Working
- get_the_date() returns english Year & Day when language is Arabic
- Where to save Gutenberg plugin data?
- Error when activating a custom plugin on production server
- Add new header/footer on landing page with plugin
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- I can’t write in my DB using $wpdb->insert
- Multi hook deploiement
- Endpoint Callback Display for Custom Plugin
- Get Commentor IP When Marking Comment As Spam
- Displaying $_FILES data (simlar to $_POST)
- Plugin options page – save two related options as one entry
- Best practice to include custom user styles in widgets
- How to remove city field from order in dashboard?
- Sending Parameter Failed
- Invalid Menu Items
- Find Any Theme’s page.php File
- WP Job Manager – Show recent jobs as cards
- How will i add an option under customizer the event calendar section?
- Return custom product in ajax call loop
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Admin Menu for New Post
- Elementor Top-Bar
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?
- Is using upgrader_process_complete the correct way to perform plugin updates?
- Load images from CDN and custom features to “Add Media” dialogue
- Saving metabox updates causing fatal error
- Calling get_header() with installed FSE theme
- Reinitiate Gutenburg’s blocks using javascript
- Generating Multiple Divi Pages from Database
- Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it
- multiple record insert creating many duplicate records