You should not create output on an activation hook. WordPress treats this as an error.
There is also no reason to create a class instance if you don’t use it.
Related Posts:
- What does ‘super’ do in Python? – difference between super().__init__() and explicit superclass __init__()
- What is Inversion of Control?
- What is an example of the Liskov Substitution Principle?
- What __init__ and self do in Python?
- When should you use a class vs a struct in C++?
- C++ error ‘Undefined reference to Class::Function()’ [duplicate]
- What’s the difference between a method and a function?
- How do I implement interfaces in python?
- What is polymorphism, what is it for, and how is it used?
- java – invalid method declaration; return type required [duplicate]
- java – invalid method declaration; return type required
- Is C++ an Object Oriented language?
- Difference between abstraction and encapsulation?
- What are metaclasses in Python?
- extends class and implements interface in java
- What is a “driver class”?
- What is difference between functional and imperative programming languages?
- How can I create a copy of an object in Python?
- What is polymorphism in Javascript?
- When should I be using classes in Python?
- How to create a subclass in C#?
- How would one write object-oriented code in C?
- How to get a JavaScript object’s class?
- Inheritance vs. Aggregation [closed]
- What is the difference between an Instance and an Object?
- What does ‘low in coupling and high in cohesion’ mean
- What is an example of the Single Responsibility Principle?
- Will WordPress become completely OOP?
- How to name files of namespaced classes?
- What is the best way to instantiate a class of a plugin in your WordPress theme?
- problem with implementing widget via the_content()
- Load classes using spl_autoload_register
- UML diagrams of WordPress
- Trying to get property of non-object
- Static vs Dynamic methods in WordPress
- Autoloader not finding classes from my plugin
- Integration tests test script enqueue/register fails
- Error of “Call a member function on non object” while var_dump get correct result
- How pass args to wp_list_comments callback?
- Does &$this is really disallowed to use anywhere?
- Don’t filters violate the a class’ local variables visibility rules?
- Admin submenu does not call function to load the page
- Using Geo Data Store Plugin Code
- How to wait for WordPress Core to load when writing OOP?
- How to get parameters with add_filter with a static method?
- Understanding Python super() with __init__() methods [duplicate]
- Difference between virtual and abstract methods
- Error “C++ requires a type specifier for all declarations whilst defining methods”
- How to implement a binary search tree in Python?
- Already defined in .obj – no double inclusions
- How to call a parent class function from derived class function?
- Why do some classes require main methods and others do not?
- Can you pass-by-reference in R?
- How do you implement a class in C?
- What’s wrong with overridable method calls in constructors?
- Does ECMAScript 6 have a convention for abstract classes?
- Explaining Python’s ‘__enter__’ and ‘__exit__’
- Using OOP in themes
- Get menu object from theme_location
- Using a plugin class inside a template
- __NAMESPACE__ with register_activation_hook
- How Can I Add a Filter to Class Instance Only?
- Adding an admin page – OOP approach not working
- Plugin Architecture/Design Pattern – is better to use a private Observer/Mediator Pattern for plugin subclasses or WP add_action?
- scheduled event not getting executed
- Using the media uploader in a custom plugin
- Hooks are not executing
- Using a front controller in a WordPress plugin, any suggestions?
- How to run query inside a class with namespace?
- Load comments per post on click with AJAX
- When to use ‘get_category_by_path’ vs. ‘get_term_by’ to get category object from `get_query_var( ‘category_name’ )`?
- WordPress Ajax callback function from plugin – OOP
- Creating a custom post type using a object oriented approach?
- Override WP Class Private Function
- Shortcode Inside Class Not Working
- restore_current_blog required after switch_to_blog, if I use that in a function?
- Getting user roles in plugin files
- Plugin activation hook in an abstract class
- Registering and using actions which return results in a Plugin class
- Most efficient way to use classes to create admin pages using Settings API
- trouble calling an import class from an action in a plugin before wp_cron executes
- How can I unhook this action that was added via $this?
- Using OOP inside a Plugin – Is it allowed?
- A question about add_action()
- Loop through an array inside a class using foreach [closed]
- update_option does not work in this scenario – how do I fix?
- WordPress Custom Hook with Class method
- Bad request 400 using class based files
- Plugin Development using classes – Public & Private Callbacks
- Some custom post types did not return an object
- Proper use of Output Buffer for a whole php clas
- Error when activating a custom plugin on production server
- OOP development and hooks
- Code works on a page but not in a widget
- The writing ( with foreach) of the keys of an array of objects to a new array produces fatal error
- OOP – add_action
- Why can wordpress not find the actions I add in my constructor?
- Populate Array with values from another arrray [closed]
- Keeping Objects in Memory
- How to use filter in this situation, can not modify the structure using filter