Undefined constant "app" (500 Whoops, looks like something went wrong.)

Error

HTTP 500 Whoops, looks like something went wrong.

Undefined constant "app"

Exception

Error

  1.             $event = new BeforeSendingReminderEmails([
  2.                 'rows'         => $rows,
  3.                 'reminderType' => $reminderType,
  4.             ]);
  5.             $this-app->triggerEvent($event->getName(), $event);
  6.             OSMembershipHelper::callOverridableHelperMethod('Mail''sendReminderEmails', [$rows$bccEmail1]);
  7.         }
  8.         // Send second reminder
  1.             foreach ($this->listeners[$event->getName()] as $listener) {
  2.                 if ($event->isStopped()) {
  3.                     return $event;
  4.                 }
  5.                 $listener($event);
  6.             }
  7.         }
  8.         return $event;
  9.     }
  1.             $dispatcher $this->getDispatcher();
  2.         } catch (\UnexpectedValueException $exception) {
  3.             return null;
  4.         }
  5.         return $dispatcher->dispatch($eventName$event ?: new ApplicationEvent($eventName$this));
  6.     }
  7.     /**
  8.      * Method to run the application routines.
  9.      *
AbstractApplication->dispatchEvent('onAfterRespond', object(AfterRespondEvent)) in /home/usbf/public_html/libraries/src/Application/CMSApplication.php (line 347)
  1.         // Send the application response.
  2.         $this->respond();
  3.         // Trigger the onAfterRespond event.
  4.         $this->dispatchEvent(
  5.             'onAfterRespond',
  6.             new AfterRespondEvent('onAfterRespond', ['subject' => $this])
  7.         );
  8.     }
CMSApplication->execute() in /home/usbf/public_html/includes/app.php (line 58)
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/home/usbf/public_html/includes/app.php') in /home/usbf/public_html/index.php (line 51)
  1.     // ... die
  2.     die();
  3. }
  4. // Run the application - All executable code should be triggered through this file
  5. require_once __DIR__ '/includes/app.php';

Stack Trace

Error
Error:
Undefined constant "app"

  at /home/usbf/public_html/plugins/system/osmembershipreminder/osmembershipreminder.php:150
  at plgSystemOSMembershipReminder->onAfterRespond(object(BeforeSendingReminderEmails))
     (/home/usbf/public_html/libraries/vendor/joomla/event/src/Dispatcher.php:454)
  at Joomla\Event\Dispatcher->dispatch('onAfterRespond', object(AfterRespondEvent))
     (/home/usbf/public_html/libraries/vendor/joomla/application/src/AbstractApplication.php:99)
  at Joomla\Application\AbstractApplication->dispatchEvent('onAfterRespond', object(AfterRespondEvent))
     (/home/usbf/public_html/libraries/src/Application/CMSApplication.php:347)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/home/usbf/public_html/includes/app.php:58)
  at require_once('/home/usbf/public_html/includes/app.php')
     (/home/usbf/public_html/index.php:51)