{"id":150,"date":"2014-10-16T23:22:28","date_gmt":"2014-10-16T23:22:28","guid":{"rendered":"http:\/\/128.199.176.160\/?p=150"},"modified":"2021-02-08T12:01:14","modified_gmt":"2021-02-08T07:01:14","slug":"check-plugin-activation-in-wordpress","status":"publish","type":"post","link":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/","title":{"rendered":"How to check a specific plugin is activated or not ?"},"content":{"rendered":"<p>While working on the EDD (<strong>Easy Digital Downloads<\/strong>) add-on of Analytify, I was looking for a way to check if the Easy Digital Downloads plugin is already activated or not. So, a message should appear to our users that &#8220;<strong>They should Activate Easy Digital Downloads to make the <em>Analytify for EDD<\/em> work properly.<\/strong> &#8221;<\/p>\n<p>Almost every plugin has a class name, we can use the <strong>PHP function<\/strong> &#8216;<strong>class_exists<\/strong>&#8216; to know if it exists or not. Following is the code which can be used to check a plugin is activate or not.<\/p>\n<pre class=\"lang:default decode:true\">add_action( 'admin_notices', array(\r\n                                  &amp;amp;$this,\r\n                                  'analytify_edd_plugin_notices'\r\n));\r\npublic function analytify_edd_plugin_notices() {\r\n\r\nif( !class_exists( 'Easy_Digital_Downloads' ) )\r\necho \"&lt;div class=\"error\"&gt;\" . __( \"Easy Digital Downloads is not active. So, Analytify for EDD Add-on will not work properly.\", 'wp-analytify' ).\"&lt;\/div&gt;\";\r\n\r\n}<\/pre>\n<p>If you know any other way to achieve the same task, do let us know. \u00a0Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While working on the EDD (Easy Digital Downloads) add-on of Analytify, I was looking for a way to check if the Easy Digital Downloads plugin is already activated or not. So, a message should appear to our users that &ldquo;They should Activate Easy Digital Downloads to make the Analytify for EDD work properly. &rdquo; Almost [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":309,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_analytify_skip_tracking":false,"footnotes":""},"categories":[53,570],"tags":[13,12,17,16,15,14],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-wordpress-plugin","tag-action","tag-admin_notices","tag-analytify","tag-easy-digital-downloads","tag-edd","tag-hook"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to check a specific plugin is activated or not ? - WPBrigade<\/title>\n<meta name=\"description\" content=\"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to check a specific plugin is activated or not ?\" \/>\n<meta property=\"og:description\" content=\"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"WPBrigade\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/WPBrigade\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-16T23:22:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-08T07:01:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png\" \/>\n\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Adnan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpbrigade\" \/>\n<meta name=\"twitter:site\" content=\"@wpbrigade\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adnan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\"},\"author\":{\"name\":\"Adnan\",\"@id\":\"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634\"},\"headline\":\"How to check a specific plugin is activated or not ?\",\"datePublished\":\"2014-10-16T23:22:28+00:00\",\"dateModified\":\"2021-02-08T07:01:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\"},\"wordCount\":117,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/wpbrigade.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png\",\"keywords\":[\"action\",\"admin_notices\",\"Analytify\",\"Easy Digital Downloads\",\"EDD\",\"hook\"],\"articleSection\":[\"How-to\",\"WordPress Plugin\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\",\"url\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\",\"name\":\"How to check a specific plugin is activated or not ? - WPBrigade\",\"isPartOf\":{\"@id\":\"https:\/\/wpbrigade.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png\",\"datePublished\":\"2014-10-16T23:22:28+00:00\",\"dateModified\":\"2021-02-08T07:01:14+00:00\",\"description\":\"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage\",\"url\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png\",\"contentUrl\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png\",\"width\":350,\"height\":350,\"caption\":\"how to check a specific plugin is activated or not\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpbrigade.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to check a specific plugin is activated or not ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpbrigade.com\/#website\",\"url\":\"https:\/\/wpbrigade.com\/\",\"name\":\"WPBrigade\",\"description\":\"WordPress Development Agency\",\"publisher\":{\"@id\":\"https:\/\/wpbrigade.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpbrigade.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wpbrigade.com\/#organization\",\"name\":\"WPBrigade\",\"url\":\"https:\/\/wpbrigade.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png\",\"contentUrl\":\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png\",\"width\":271,\"height\":63,\"caption\":\"WPBrigade\"},\"image\":{\"@id\":\"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/WPBrigade\",\"https:\/\/x.com\/wpbrigade\",\"https:\/\/www.instagram.com\/wpbrigade.agency\/\",\"https:\/\/www.linkedin.com\/company\/wpbrigade\",\"https:\/\/www.youtube.com\/c\/Wpbrigade\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634\",\"name\":\"Adnan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"caption\":\"Adnan\"},\"sameAs\":[\"http:\/\/adnan.pk\/\",\"https:\/\/x.com\/wpbrigade\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to check a specific plugin is activated or not ? - WPBrigade","description":"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to check a specific plugin is activated or not ?","og_description":"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.","og_url":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/","og_site_name":"WPBrigade","article_publisher":"https:\/\/facebook.com\/WPBrigade","article_published_time":"2014-10-16T23:22:28+00:00","article_modified_time":"2021-02-08T07:01:14+00:00","og_image":[{"width":350,"height":350,"url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png","type":"image\/png"}],"author":"Adnan","twitter_card":"summary_large_image","twitter_creator":"@wpbrigade","twitter_site":"@wpbrigade","twitter_misc":{"Written by":"Adnan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/"},"author":{"name":"Adnan","@id":"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634"},"headline":"How to check a specific plugin is activated or not ?","datePublished":"2014-10-16T23:22:28+00:00","dateModified":"2021-02-08T07:01:14+00:00","mainEntityOfPage":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/"},"wordCount":117,"commentCount":0,"publisher":{"@id":"https:\/\/wpbrigade.com\/#organization"},"image":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png","keywords":["action","admin_notices","Analytify","Easy Digital Downloads","EDD","hook"],"articleSection":["How-to","WordPress Plugin"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/","url":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/","name":"How to check a specific plugin is activated or not ? - WPBrigade","isPartOf":{"@id":"https:\/\/wpbrigade.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png","datePublished":"2014-10-16T23:22:28+00:00","dateModified":"2021-02-08T07:01:14+00:00","description":"How to check a specific plugin is activated or not by adding the code to your wordpress website and check plugin is active or not.","breadcrumb":{"@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#primaryimage","url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png","contentUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/10\/plugin-activated.png","width":350,"height":350,"caption":"how to check a specific plugin is activated or not"},{"@type":"BreadcrumbList","@id":"https:\/\/wpbrigade.com\/check-plugin-activation-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpbrigade.com\/"},{"@type":"ListItem","position":2,"name":"How to check a specific plugin is activated or not ?"}]},{"@type":"WebSite","@id":"https:\/\/wpbrigade.com\/#website","url":"https:\/\/wpbrigade.com\/","name":"WPBrigade","description":"WordPress Development Agency","publisher":{"@id":"https:\/\/wpbrigade.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpbrigade.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpbrigade.com\/#organization","name":"WPBrigade","url":"https:\/\/wpbrigade.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png","contentUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png","width":271,"height":63,"caption":"WPBrigade"},"image":{"@id":"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/WPBrigade","https:\/\/x.com\/wpbrigade","https:\/\/www.instagram.com\/wpbrigade.agency\/","https:\/\/www.linkedin.com\/company\/wpbrigade","https:\/\/www.youtube.com\/c\/Wpbrigade"]},{"@type":"Person","@id":"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634","name":"Adnan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","caption":"Adnan"},"sameAs":["http:\/\/adnan.pk\/","https:\/\/x.com\/wpbrigade"]}]}},"_links":{"self":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/comments?post=150"}],"version-history":[{"count":0,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts\/150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/media\/309"}],"wp:attachment":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}