/** * Optional manual notification checks (debug only). * * Production entry/reminder pushes use Firebase Functions and the mobile app. * WordPress no longer schedules opportunity notification crons. * * Usage (must be logged in as administrator): * https://your-site.com/wp-admin/?pl_app_control_run_checks=1 */ function pl_app_control_manual_check_trigger() { // Only run in admin area and when the debug parameter is set if (is_admin() && isset($_GET['pl_app_control_run_checks'])) { // Authenticate user if (!current_user_can('manage_options')) { wp_die('You do not have permission to access this page.'); } // Get required managers $firestore = new \PL_App_Control\Firebase\PL_Firestore_Manager(); $messaging = new \PL_App_Control\Firebase\PL_Messaging_Manager(); $notification_logs = new \PL_App_Control\Logging\PL_Notification_Log_Manager(); // Create notification manager instance $notification_manager = new \PL_App_Control\Integrations\PL_Salesforce_Notification_Manager( $firestore, $messaging, $notification_logs ); // Run the checks $notification_manager->check_opportunities(); $notification_manager->check_upcoming_opportunities(); // Log that the checks were run error_log("Manual notification checks triggered by admin"); // Display notice add_action('admin_notices', function() { echo '
'; echo '

' . esc_html__('Notification checks have been manually triggered. Check the logs for results.', 'pure-locations-app-control') . '

'; echo '
'; }); } } add_action('admin_init', 'pl_app_control_manual_check_trigger'); Pure Locations: Event & Production Venue Hire