Calling is_single() outside the loop
At first, you’re calling a WordPress function directly inside a new instance of your class which can lead to a null wp_query state which produces a log when calling your code. To fix this you should move the call to a place somewhere like the init hook, like this: class Something() { public function __construct() … Read more