is_plugin_active()
expects just the base name of the plugin as parameter:
So use:
is_plugin_active( 'woocommerce/woocommerce.php' );
The function will use the option 'active_plugins'
which is a list of plugins paths relative to the plugin directory already.
On a multi-site installation it will search in get_site_option( 'active_sitewide_plugins')
too.
As an implementation note: Avoid these checks. Some users rename plugin names or directories. Test for the functions you will actually use instead, eg:
if ( function_exists( 'woocommerce_get_page_id' ) )
{
// do something
}
Related Posts:
- How do I replace a function, declared inside a plugin’s class, in functions.php?
- Unable to check if plugin is active
- How to include a plugin’s php file to another plugin functions file [duplicate]
- Problem requiring/including plugin files with plugin_dir_path( __FILE__ )
- Why does including a file in theme’s functions.php not work?
- Include files for a plugin not including
- Adding rich text editor to my plugin
- I need to add a custom “cover” to every new post — plugin or custom setup?
- Creating plugin using simple_html_dom parser?
- Use of Templates in a Plugin
- Include comments form in plugin page
- WP Plugins – Use includes to display page content
- Use $variable from file1.php in file2.php (different file paths)
- Trying to include files in plugin isn’t working
- Using plugin_dir_path() with WordPress on MAMP
- Displaying page content from plugin, inside exising empty WP page
- FPDF for creating pdf diplomas
- How to write wordpress plugins faster to load?
- show Visual form builder in the front end
- Include paths and functions for external scripts
- Including a PHP file via a function that is part of a plugin?
- Shortcode return is printing a 1 afterward
- White Screen When Includding A Folder With PHP Files
- php include returns 1 as output with other outputs [closed]
- Display file contents within Plugin
- WooCommerce store with ~30,000 products [closed]
- Beta Versioning of Plugins
- How can I make default jquery version of WordPress “async”?
- WooCommerce – Show shipping cost on product page [closed]
- Importing Tweets with certain hashtags into WordPress
- Get php var inside javascript file (making plugin)
- Find out what is using PHP sessions in WordPress
- Override dynamic_sidebar() in plugin?
- publish_post hook isn’t working for scheduled posts
- Add post thumbnail from external image with plugin
- Why is this custom taxonomy showing in the database?
- Where is the source code that makes the “all” array grabs filters in the $wp_filter?
- How can I change plugin to give access to editor user role?
- Is it possible to add an action to the currently running action?
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- unzip a folder on specific location and delete the zip file
- Check if User exists in WordPress Multisite
- Embed a Google Sheet as you view it in a separate tab?
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- Plugin version is not showing up in wordpress.org plugin directory
- Saving changes in wp_editor
- There is any way to remove post-format filter? [closed]
- Search for categories
- Best way to initiate a class in a WP plugin?
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Retrieving Meta from Image Attachment
- Why this function not working for install database on plugin activation
- The Hook registration_errors was not called
- Problems With WP Bannarize Plugin [closed]
- How to create a child/addon plugin
- How to secure the release of WordPress plugins / avoid copying plugins?
- What happens if I don’t update my plugins?
- WordPress Users authentication with Java Application
- remove_action not removing add_action from constructor
- Is there a way to make the main page only display a brief description of the full article?
- Limit WP code scope into plugin
- WordPress custom plugin that uses woocommerce enabled payment gateway for payment [closed]
- Execute a function when the entire page is displayed
- Is there any way to inject text onto pages?
- Plugin that lets visitors Like a post (not facebook) and stores likes in custom meta?
- Cannot read properties of undefined (reading ‘firstChild’) using photoswipe in product page
- Multisite Change from domain.com to sub.newdomain.com
- Find Plugin by file name
- Creating an admin button that when clicked shows a popup form
- How to list datas from database in a topic?
- How to hide an option from dropdown in filter module
- Downloading a file
- Profiling the initial PHP file, anyone, that get like 10 seconds to load
- How use wp_insert_post and add og:custom tags?
- How to change “Read More” text?
- How to use wp_editor and save its data in wp_posts table
- WordPress database problem wp_posts, primary key
- Auto trigger of popup
- WordPress Plugin PHP Not Calling Function
- how to show the tables of my plugin in the export tab of WordPress?
- how do i fixe Page Builder on a custom page?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Do_shortcode before send email content
- wp_enqueue_scrpts seems not to get called
- How to Create Custom Dashboard for my Laundry Website?
- Warning: Illegal offset type in /var/www/html/wp-includes/option.php on line 1924
- Get plugin to background of page
- What is a good way to test that plugin upgrades have completed properly?
- get post excerpt by query
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- Remove the ‘Press This’ Tool
- Looking for a related post plugin which slides-in like the one at inc.com does [closed]
- which is this plugin ? [closed]
- Woocommerce Product Add-ons – Auto-select first option
- Sync roles across several plugins
- How to write a specific url for only single page in wordpress?
- Identifying Plugins Based on Tables [closed]
- edit slider plugin capability for custom_role
- Plugin Block at the backend of every page or post
- How Create LastMod and Update Date Only on Taxonomy Category and Tags