📁 File Manager Pro
v10.0.3 | PHP: 7.4.33
Server: LiteSpeed
2026-06-26 06:39:22
📂
/ (Root)
/
home
/
supecsoq
/
public_html
/
domains
/
migalexpark.com
/
wp-content
/
plugins
/
user-activity-log
/
includes
📍 /home/supecsoq/public_html/domains/migalexpark.com/wp-content/plugins/user-activity-log/includes
🔄 Refresh
✏️
Editing: ual-gravityform.php
Writable
<?php /** * Exit if accessed directly */ if (!defined('ABSPATH')) { exit; } /** * Fires once the admin request has been validated or not. * * @param string $action The nonce action. * @param false|int $result False if the nonce is invalid, * 1 if the nonce is valid and generated between 0-12 hours ago, * 2 if the nonce is valid and generated between 12-24 hours ago. */ if (!function_exists('ualGformsSaveEntry')){ function ualGformsSaveEntry($action_type,$result) { $obj_type = 'Gravity Form'; $post_id = ''; $hook = $action_type; if( $action_type == 'gf_export_forms' ) { $action = 'Form exported'; if ( isset( $_POST['export_forms'] ) ) { $selected_forms = rgpost( 'gf_form_id' ); if(is_array($selected_forms)){ foreach ($selected_forms as $selected_form){ $form = GFFormsModel::get_form_meta( $selected_form ); $post_title = $form['title'] .' '.$action; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } } } } } add_action('check_admin_referer', 'ualGformsSaveEntry', 10, 2); /** * Fires once Notification duplicated. * * @param string $action The nonce action. * @param false|int $result False if the nonce is invalid, * 1 if the nonce is valid and generated between 0-12 hours ago, * 2 if the nonce is valid and generated between 12-24 hours ago. */ if (!function_exists('ualGformsDuplicateNotify')){ function ualGformsDuplicateNotify($action,$result) { if($action == "gform_notification_list_action" ) { $actions = rgpost( 'action' ); if($actions == "duplicate"){ $form_id = rgget( 'id' ); $notification_id = rgpost( 'action_argument' ); $form = GFFormsModel::get_form_meta( $form_id ); $notification_title = $form['notifications'][$notification_id]['name']; $post_title = $notification_title .' notification duplicated for'.$form['title']; $obj_type = 'Gravity Form'; $post_id = ''; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } } } add_action('check_admin_referer', 'ualGformsDuplicateNotify', 10, 2); /** * Fired after an entry is created * * @param array $lead The Entry object * @param array $form The Form object */ if (!function_exists('ual_gform_entry_created')){ function ual_gform_entry_created($lead, $form) { $lead_id = (isset($lead)) ? $lead['id'] : ''; if(isset($lead_id) && $lead_id != ''){ $lead_title = $lead[1]; $form_title = ''; if(isset($form['title']) && !empty($form['title'])){ $form_title = $form['title']; } $action = 'created'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = 'New entry '.$lead_title .' created in '.$form_title .' Form'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } } add_action('gform_entry_created', 'ual_gform_entry_created', 20, 2); /** * Fires when resend email notifications */ if (!function_exists('ual_wp_ajax_gf_resend_notifications')){ function ual_wp_ajax_gf_resend_notifications() { $form_id = absint( rgpost( 'formId' ) ); $leads = rgpost( 'leadIds' ); if ( !empty( $leads ) && !empty( $form_id ) ) { $form = GFFormsModel::get_form_meta( $form_id ); $action = ''; $obj_type = "Gravity Form"; $post_id = ''; $hook = "gf_resend_notifications"; foreach($leads as $single_lead){ $lead = GFFormsModel::get_lead( $single_lead ); $post_title = 'Notifications for '.$lead[1] .' entry resent for '.$form['title'] .' form'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } } } add_action('wp_ajax_gf_resend_notifications', 'ual_wp_ajax_gf_resend_notifications'); /** * Fires before a note is deleted * * @param int $note_id The current note ID * @param int $lead_id The current lead ID */ if (!function_exists('ualgform_pre_note_deleted')){ function ualgform_pre_note_deleted($note_id, $lead_id) { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $action = 'deleted'; $post_id = ''; $obj_type = 'Gravity Form'; $post_title = $note_id.' note deleted from lead ' .$lead_id .' on '.$form['title'].' form'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_pre_note_deleted', 'ualgform_pre_note_deleted',10,2); // todo /** * Fires when settings updated * * @param string $option * @param string $oldvalue * @param string $_newvalue */ if(!function_exists('ualGarvityFormUpdatedOption')){ function ualGarvityFormUpdatedOption($option, $oldvalue = null, $_newvalue = null) { $whitelist_options = array( 'gform_enable_noconflict', 'gform_enable_toolbar_menu', 'gform_enable_background_updates', 'gform_enable_logging', 'rg_gforms_currency', 'rg_gforms_key', 'rg_gforms_enable_html5', 'rg_gforms_disable_css', 'rg_gforms_captcha_public_key', 'rg_gforms_captcha_private_key', ); if (!in_array($option, $whitelist_options)) return; $action = "updated"; $obj_type = "Settings"; $post_id = ''; $post_title = $option; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('updated_option', 'ualGarvityFormUpdatedOption', 20, 3); add_action('delete_option', 'ualGarvityFormUpdatedOption', 20, 3); add_action('add_option', 'ualGarvityFormUpdatedOption', 20, 3); /** * Fires after exporting all the entries in form * * @param array $form The Form object to get the entries from * @param string $start_date The start date for when the export of entries should take place * @param string $end_date The end date for when the export of entries should stop * @param array $fields The specified fields where the entries should be exported from */ if (!function_exists('ualgform_post_export_entries')){ function ualgform_post_export_entries($form, $start_date, $end_date, $fields) { $action = 'form entries exported'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $form['title'].' form entries exported'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_export_entries', 'ualgform_post_export_entries',10,4); /** * Fires after a note has been added to an entry * * @param int $note_id The row ID of this note in the database * @param int $lead_id The ID of the entry that the note was added to * @param int $user_id The ID of the current user adding the note * @param string $user_name The user name of the current user * @param string $note The content of the note being added * @param string $note_type The type of note being added. Defaults to 'note' */ if (!function_exists('ualgform_post_note_added')){ function ualgform_post_note_added($note_id, $lead_id, $user_id, $user_name, $note, $note_type) { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $action = 'added'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $note_id.' note added to lead '.$lead_id.' on '.$form['title'].' form'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_note_added', 'ualgform_post_note_added', 10, 6); // todo /** * Fires when you delete entries for a specific form * * @param int $form_id The form ID to specify from which form to delete entries * @param string $status Allows you to set the form entries to a deleted status */ if (!function_exists('ualgform_delete_entries')){ function ualgform_delete_entries($form_id, $status) { $form = GFFormsModel::get_form_meta( $form_id ); $form_title = $form['title']; $action = ''; $post_id = ''; $obj_type = 'Gravity Form'; $post_title = 'Entry deleted from '.$form_title; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_delete_entries', 'ualgform_delete_entries', 10, 2); // todo /** * Fires after form views are deleted * * @param int $form_id The ID of the form that views were deleted from */ if (!function_exists('ualgform_post_form_views_deleted')){ function ualgform_post_form_views_deleted($form_id) { $action = 'view Reset'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form view Reset'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_views_deleted', 'ualgform_post_form_views_deleted', 10, 1); /** * Fires after an inactive form gets marked as active * * @param int $form_id The Form ID used to specify which form to activate */ if (!function_exists('ualgform_post_form_activated')){ function ualgform_post_form_activated($form_id) { $action = 'activated'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form activated'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_activated', 'ualgform_post_form_activated', 10, 1); /** * Fires after an active form gets marked as inactive * * @param int $form_id The Form ID used to specify which form to activate */ if (!function_exists('ualgform_post_form_deactivated')){ function ualgform_post_form_deactivated($form_id) { $action = 'deactivated'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form deactivated'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_deactivated', 'ualgform_post_form_deactivated', 10, 1); /** * Fires before a form is deleted * * @param int $form_id The ID of the form being deleted */ if (!function_exists('ualgform_before_delete_form')){ function ualgform_before_delete_form($form_id) { $action = 'deleted'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form deleted'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_before_delete_form', 'ualgform_before_delete_form', 10, 1); /** * Fires after a form is trashed * * @param int $form_id The ID of the form that was trashed */ if (!function_exists('ualgform_post_form_trashed')){ function ualgform_post_form_trashed($form_id) { $form = GFFormsModel::get_form_meta( $form_id ); $action = 'trashed'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $form['title'].' Form trashed'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_trashed', 'ualgform_post_form_trashed', 10, 1); /** * Fires after a form is restored from trash * * @param int $form_id The ID of the form that was restored */ if (!function_exists('ualgform_post_form_restored')){ function ualgform_post_form_restored($form_id) { $action = 'restored'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form restored'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_restored', 'ualgform_post_form_restored', 10, 1); /** * Fires after a form is duplicated * * @param int $form_id The original form's ID * @param int $new_id The ID of the new, duplicated form */ if (!function_exists('ualgform_post_form_duplicated')){ function ualgform_post_form_duplicated($form_id,$new_id) { $action = 'duplicated'; $obj_type = 'Gravity Form'; $post_id = ''; $form = GFFormsModel::get_form_meta( $form_id ); $post_title = $form['title'].' Form duplicated'; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_post_form_duplicated', 'ualgform_post_form_duplicated', 10, 2); /** * Fires after a form is saved * * Used to run additional actions after the form is saved * * @param array $form_meta The form meta * @param bool true Returns true if this is a new form. */ if (!function_exists('ualgform_after_save_form')){ function ualgform_after_save_form($form_meta,$flag) { $obj_type = 'Gravity Form'; $post_id = ''; $action = $flag ? 'created' : 'updated'; $post_title = $form_meta['title'].' form '.$action; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_after_save_form', 'ualgform_after_save_form', 10, 2); /** * Fires after forms have been imported. * * Used to perform additional actions after import * * @param array $forms An array imported form objects. * */ if (!function_exists('ualgform_forms_post_import')){ function ualgform_forms_post_import($forms) { $forms_total = count( $forms ); $forms_label = ( 1 === $forms_total ) ? 'form' : 'forms'; $forms_ids = wp_list_pluck( $forms, 'id' ); $forms_titles = wp_list_pluck( $forms, 'title' ); $forms_title = implode(',', $forms_titles); $action = 'imported'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $forms_title.' '.$forms_total.' '.$forms_label.' '.$action; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_forms_post_import', 'ualgform_forms_post_import', 10, 1); /** * Fires before a notification is deleted. * * @param array $notification_id The notification being deleted. * @param array $form The Form Object that the notification is being deleted from. */ if (!function_exists('ualgform_pre_notification_deleted')){ function ualgform_pre_notification_deleted($notification_id, $form ) { $action = ''; $obj_type = 'Gravity Form'; $post_id = ''; $hook = 'gform_pre_notification_deleted'; $post_title = $notification_id['name'] .' Notification deleted from '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_pre_notification_deleted', 'ualgform_pre_notification_deleted', 10, 2); /** * Fires right before a confirmation is deleted. * * @param int $confirmation_id The ID of the confirmation being deleted. * @param array $form The Form object. */ if (!function_exists('ualgform_pre_confirmation_deleted')){ function ualgform_pre_confirmation_deleted($confirmation_id,$form) { $action = 'confirmation deleted'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $confirmation_id['name'] .' '. $action .' from '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_pre_confirmation_deleted', 'ualgform_pre_confirmation_deleted', 10, 2); /** * Fires when update notification saved */ if (!function_exists('ualwp_ajax_rg_update_notification_active')){ function ualwp_ajax_rg_update_notification_active() { if(isset($_POST['is_active']) && $_POST['is_active'] == 1){ $action = 'active'; } else{ $action = 'inactive'; } $form_id = (isset($_POST['form_id']) && !empty($_POST['form_id'])) ? intval($_POST['form_id']) : ''; $form = GFFormsModel::get_form_meta( $form_id ); $notification_id = (isset($_POST['notification_id']) && !empty($_POST['notification_id'])) ? intval($_POST['notification_id']) : ''; $notification_title = $form['notifications'][$notification_id]['name']; $obj_type = "Gravity Form"; $post_id = ''; $post_title = $notification_title .' notification '. $action .' for '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('wp_ajax_rg_update_notification_active', 'ualwp_ajax_rg_update_notification_active'); /** * Fires when confirmation activated */ if (!function_exists('ual_ajax_rg_update_confirmation_active')){ function ual_ajax_rg_update_confirmation_active() { if(isset($_POST['is_active']) && $_POST['is_active'] == 1){ $action = 'active'; }else{ $action = 'inactive'; } $form_id = (isset($_POST['form_id']) && !empty($_POST['form_id'])) ? intval($_POST['form_id']) : ''; $form = GFFormsModel::get_form_meta( $form_id ); $confirmation_id = (isset($_POST['confirmation_id']) && !empty($_POST['confirmation_id'])) ? intval($_POST['confirmation_id']) : ''; $c_title = $form['confirmations'][$confirmation_id]['name']; $post_id = ''; $obj_type = "Gravity Form"; $post_title = $c_title .' confirmation '. $action .' for '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('wp_ajax_rg_update_confirmation_active', 'ual_ajax_rg_update_confirmation_active'); /** * Fires when saving form confirmations * * @param array $confirmation * @param array $form * @param bool $is_new * @return array */ if(!function_exists('ualgform_confirmation_save')){ function ualgform_confirmation_save( $confirmation, $form, $is_new = true ){ $confirmation_name = $confirmation['name']; $action = $is_new ? 'created' : 'updated'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $confirmation_name .' confirmation '. $action .' for '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); return $confirmation; } } add_filter('gform_pre_confirmation_save', 'ualgform_confirmation_save', 10, 3); /** * Fires when saving form notification * * @param array $notification * @param array $form * @param bool $is_new * @return array */ if(!function_exists('ualgform_notification_save')){ function ualgform_notification_save( $notification, $form, $is_new = true ){ $action = $is_new ? 'created' : 'updated'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = $notification['name'].' notification' . $action . ' for '.$form['title']; ual_get_activity_function($action, $obj_type, $post_id, $post_title); return $notification; } } add_filter('gform_pre_notification_save', 'ualgform_notification_save', 10, 3); /** * Fires after form lead is deleted * * @param int $lead_id The ID of the lead */ if (!function_exists('ualgform_post_lead_deleted')){ function ualgform_post_lead_deleted($lead_id) { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $action = "deleted"; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = "Entry '$lead[1]' from '" . $form['title'] ."' ".$action; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_delete_lead', 'ualgform_post_lead_deleted', 10, 1); /** * Fires before form status updated * * @param string $status Current Status * @param string $status Previous Status * @param int $lead_id The current lead ID */ if (!function_exists('ualgform_update_status')){ function ualgform_update_status($lead_id, $status, $prev = '') { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); if ( 'active' === $status && 'trash' === $prev ) { $action = 'restore'; }elseif($status == 'active'){ $action = 'active'; }elseif($status == 'spam'){ $action = 'spam'; }elseif($status == 'trash'){ $action = 'trash'; }elseif($status == 'restore'){ $action = 'restore'; }else{ $action = $status; } $obj_type = 'Gravity Form'; $post_id = ''; $post_title = "Entry '$lead[1]' $action on '".$form['title']."' form"; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_update_status', 'ualgform_update_status',10,3); /** * Fires before read entry * * @param int $status Current status * @param int $lead_id The current lead ID */ if (!function_exists('ualgform_read_entry')){ function ualgform_read_entry( $lead_id, $status ) { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $action = ( ! empty( $status ) ) ? 'read' : 'unread'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = "Entry '$lead[1]' marked as $action on '".$form['title']."' form"; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_update_is_read', 'ualgform_read_entry',10,2); /** * Fires before entry marked as starred * * @param int $status Current status * @param int $lead_id The current lead ID */ if (!function_exists('ualgform_mark_starred')){ function ualgform_mark_starred( $lead_id, $status ) { $lead = GFFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $action = ( ! empty( $status ) ) ? 'starred' : 'unstarred'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = "Entry '$lead[1]' $action on '".$form['title']."' form"; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } add_action('gform_update_is_starred', 'ualgform_mark_starred',10,2); /** * Fires when settings updated * * @param string $option * @param string $oldvalue * @param string $_newvalue */ if(!function_exists('ualGarvityFormLicenceUpdated')){ function ualGarvityFormLicenceUpdated($option, $oldvalue, $_newvalue) { if($option == 'rg_gforms_key'){ $is_update = ( $_newvalue && strlen( $_newvalue ) ); $action = $is_update ? 'updated' : 'deleted'; $obj_type = 'Gravity Form'; $post_id = ''; $post_title = 'Gravity Forms license key '.$action; ual_get_activity_function($action, $obj_type, $post_id, $post_title); } } } add_action('updated_option', 'ualGarvityFormLicenceUpdated', 20, 3);
💾 Save Changes
❌ Cancel