Activation hook is fired while the plugin is being activated, at best it is a dangerous assumption to make that at that point it is already active, and if it is not active, obviously you can not deactivate it.
If you are looking for a way to fail the activation, the best way is probably to die()
Related Posts:
- Delete tables from database when deleting plugin
- Show a confirm message before plug-in activation
- Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?
- Many plugins making WordPress run slow by design?
- Plugin Deactivate Self on Activation Errors
- Is any information available in PHP files in WP about plugin activation history?
- Does Deactivating a Plugin Help Anything?
- All plugins deactivated. What could cause this?
- WordPress 5.3 update causes media library file upload to break – Cannot convert undefined or null to object
- What plugins do you commonly install on a fresh WordPress install?
- Publish author posts only with editor approval?
- how to change default icon of custom plugin?
- List of all existing WordPress plugins
- How does WordPress official repository estimate ‘Active Installs’ of a plugin?
- How to work with Syntax Highlighter Evolved?
- WordPress Admin is displaying Not Available
- User-Specific Timezones? Hack? Plugin?
- Automattic’s eCommerce Plugin
- How to remove/hide action links cluttering under specific plugins’ names
- How to develop a community feature in the dashboard for multiauthor site
- Which hook should be used to validate custom form fields on the login form?
- Using the media uploader in a custom plugin
- Is there a plugin to protect downloads with recaptcha?
- Problem running Ajax in WordPress
- Plugin child folder?
- How would one split content of a post into pages?
- Theme and Plugins sharing common libraries
- All Updated Plugins Disappeared
- Counting pageviews on high-traffic cached sites
- How to change Thumbnail size of next Gen Gallery plugin?
- Questions about brute force attacks on the admin username, coming from amazon IP addresses
- What’s the _wp_desired_post_slug value for?
- Correct wp-content ownership and permissions
- How to check what plugins used to be on a WordPress installation?
- WooCommerce: Change default country on the cart page [closed]
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- Form doesn’t submit on second submit call
- What would be the advantages/disadvantages of remote plugin installation?
- How to slice an array using posts_per_page? [closed]
- Should I fetch the data managed by a plugin by using its APIs or WordPress APIs?
- Use translated taxonomy labels in plugin
- Show an image in my header.php
- Plugin appends ugly URL string to index
- Installing a plugin on a premium site [closed]
- White page by using filter template_include
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Facebook Messager Plugin
- How to save inputed data in a textbox [EDITED] [duplicate]
- User switching only with specific role and return
- WordPress Payment gateway add on form , how to add form into list or else how to submit form to next step for payment
- How WordPress is able to change locale without using setlocale
- Better ads plugin has 500.000 entries in wp_postmeta
- Render Modula Plugin Shortcode On Ajax Request
- Saving widget options from class method
- This WordPress plugin isn’t creating links correctly
- Basics of changing plugin output
- WordPress plugin url for form submit
- how to place a link on the first post only using a plugin
- remove ad to cart button and view more button if product price is empty
- Override plugin template
- WordPress Update Question
- “After file loaded” action
- Add_image_size not generating correct size
- navigation among single posts
- Show Homepage (only) Hits Count
- WordPress jQuery Post – Amending Variable Value Within Function Command
- Custom Post Type same name as Category
- how to display recent post by category on home page
- how to define a html folder to make it work with WordPress commands
- Asking help regarding potential malware
- When/where would want to attach other classes to the base class in a WordPress plugin?
- How to find where an image is used by it’s url
- checkout stripe with plugin contact form
- Disqus comment system not show
- Custom plugin which downloads updates from custom endpoint, extracts new version zip into a new name
- How to cache for multi server environment? Memcached, Redis or other?
- Page takes on two different formats
- Cant visualize protected password portfolio elements
- How to create multiple pages for PDFs
- How To Add Code To WP Without Plugin or Functions
- Run one-time script calling plugin functions
- Adding icons next to categories in wp_nav_menu
- admin panel save option with ajax
- Woocommerce Subscriptions – Customer change subscribed product after placed
- How to Change MU/BuddyPress Group Blog New Installation Defaults [closed]
- Retrieving old forms in Contact Form 7 [closed]
- Advice on setting up private site
- is ther a plugin that will hide/show content for a scheduled period of time? [closed]
- update_post_meta not working
- Pulling Advanced Custom Fields from other pages
- 404 not found problem with URL rewrite custom category
- Trying to use Advanced Custom Fields with custom image sizes
- Loading post that has visual composer data inside lightbox? [closed]
- Manage Inventory Without Displaying Levels
- registration plugin [closed]
- Which action/filter can i use for a Member Plugin [closed]
- How can I utilize the same “show more” functionality that I see in superuser on my own WordPress site?
- WDTException: [0]: One or more columns doesn’t have a header
- How to Add Extra Text In WordPress Title Before Post Publish
- WordPress Convert queries to slashes using function.php