[0-9.|a-zA-Z.]*)#';
preg_match_all( $pattern, $u_agent, $matches ); // get the matching numbers
// see how many we have
$i = count( $matches['browser'] );
if ( $i > 1 ) {
//we will have two since we are not using 'other' argument yet
//see if version is before or after the name
if ( strripos( $u_agent, 'Version' ) < strripos( $u_agent, $ub ) ) {
$version = $matches['version'][0];
} else {
$version = $matches['version'][1];
}
} elseif ( $i === 1 ) {
$version = $matches['version'][0];
} else {
$version = '';
}
// check if we have a number
if ( $version == '' ) {
$version = '?';
}
return $bname . ' ' . $version . ' / ' . $platform;
}
/**
* @since 3.0
*/
public static function actions_dropdown( $atts ) {
$id = isset( $atts['id'] ) ? $atts['id'] : FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
$links = self::get_action_links( $id, $atts['entry'] );
foreach ( $links as $link ) {
?>
admin_url( 'admin.php?page=formidable-entries&frm_action=show&id=' . $id . '&form=' . $entry->form_id ),
'label' => __( 'View Entry', 'formidable' ),
'icon' => 'frm_icon_font frm_save_icon',
);
}
if ( current_user_can( 'frm_delete_entries' ) ) {
$actions['frm_delete'] = array(
'url' => admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id ),
'label' => __( 'Delete Entry', 'formidable' ),
'icon' => 'frm_icon_font frm_delete_icon',
'data' => array(
'frmverify' => __( 'Delete this form entry?', 'formidable' ),
),
);
}
if ( $page == 'show' ) {
$actions['frm_print'] = array(
'url' => '#',
'label' => __( 'Print Entry', 'formidable' ),
'data' => array(
'frmprint' => '1',
),
'icon' => 'frm_icon_font frm_printer_icon',
);
}
$actions['frm_resend'] = array(
'url' => '#',
'label' => __( 'Resend Emails', 'formidable' ),
'class' => 'frm_noallow',
'data' => array(
'upgrade' => __( 'Resend Emails', 'formidable' ),
'medium' => 'resend-email',
'content' => 'entry',
),
'icon' => 'frm_icon_font frm_email_icon',
);
$actions['frm_edit'] = array(
'url' => '#',
'label' => __( 'Edit Entry', 'formidable' ),
'class' => 'frm_noallow',
'data' => array(
'upgrade' => __( 'Entry edits', 'formidable' ),
'medium' => 'edit-entries',
'content' => 'entry',
),
'icon' => 'frm_icon_font frm_pencil_icon',
);
return apply_filters( 'frm_entry_actions_dropdown', $actions, compact( 'id', 'entry' ) );
}
/**
* @since 5.0.15
*
* @param string|int $entry_id
* @return void
*/
public static function maybe_render_captcha_score( $entry_id ) {
$query = array(
'item_id' => (int) $entry_id,
'field_id' => 0,
);
$metas_without_a_field = (array) FrmEntryMeta::getAll( $query, ' ORDER BY it.created_at DESC', '', true );
foreach ( $metas_without_a_field as $meta ) {
if ( ! empty( $meta->meta_value['captcha_score'] ) ) {
echo '';
FrmAppHelper::icon_by_class( 'frm_icon_font frm_shield_check_icon', array( 'aria-hidden' => 'true' ) );
echo ' ' . esc_html__( 'reCAPTCHA Score', 'formidable' ) . ': ';
echo '' . esc_html( $meta->meta_value['captcha_score'] ) . '';
echo '
';
return;
}
}
}
}