Нет описания

wpforms-lite.php 44KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. <?php
  2. /**
  3. * WPForms Lite. Load Lite specific features/functionality.
  4. *
  5. * @since 1.2.0
  6. */
  7. class WPForms_Lite {
  8. /**
  9. * Primary class constructor.
  10. *
  11. * @since 1.2.x
  12. */
  13. public function __construct() {
  14. $this->includes();
  15. add_action( 'wpforms_form_settings_notifications', [ $this, 'form_settings_notifications' ], 8, 1 );
  16. add_action( 'wpforms_form_settings_confirmations', [ $this, 'form_settings_confirmations' ] );
  17. add_action( 'wpforms_builder_enqueues_before', [ $this, 'builder_enqueues' ] );
  18. add_action( 'wpforms_admin_page', [ $this, 'entries_page' ] );
  19. add_action( 'wpforms_admin_settings_after', [ $this, 'settings_cta' ] );
  20. add_action( 'wp_ajax_wpforms_lite_settings_upgrade', [ $this, 'settings_cta_dismiss' ] );
  21. add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueues' ] );
  22. add_filter( 'wpforms_helpers_templates_get_theme_template_paths', [ $this, 'add_templates' ] );
  23. // Entries count logging for WPForms Lite.
  24. add_action( 'wpforms_process_entry_save', [ $this, 'update_entry_count' ], 10, 3 );
  25. }
  26. /**
  27. * Include files.
  28. *
  29. * @since 1.0.0
  30. */
  31. private function includes() {
  32. }
  33. /**
  34. * Form notification settings, supports multiple notifications.
  35. *
  36. * @since 1.2.3
  37. *
  38. * @param object $settings
  39. */
  40. public function form_settings_notifications( $settings ) {
  41. $cc = wpforms_setting( 'email-carbon-copy', false );
  42. $from_name_after = apply_filters( 'wpforms_builder_notifications_from_name_after', '' );
  43. $from_email_after = apply_filters( 'wpforms_builder_notifications_from_email_after', '' );
  44. // Handle backwards compatibility.
  45. if ( empty( $settings->form_data['settings']['notifications'] ) ) {
  46. /* translators: %s - form name. */
  47. $settings->form_data['settings']['notifications'][1]['subject'] = ! empty( $settings->form_data['settings']['notification_subject'] ) ? $settings->form_data['settings']['notification_subject'] : sprintf( esc_html__( 'New %s Entry', 'wpforms-lite' ), $settings->form->post_title );
  48. $settings->form_data['settings']['notifications'][1]['email'] = ! empty( $settings->form_data['settings']['notification_email'] ) ? $settings->form_data['settings']['notification_email'] : '{admin_email}';
  49. $settings->form_data['settings']['notifications'][1]['sender_name'] = ! empty( $settings->form_data['settings']['notification_fromname'] ) ? $settings->form_data['settings']['notification_fromname'] : get_bloginfo( 'name' );
  50. $settings->form_data['settings']['notifications'][1]['sender_address'] = ! empty( $settings->form_data['settings']['notification_fromaddress'] ) ? $settings->form_data['settings']['notification_fromaddress'] : '{admin_email}';
  51. $settings->form_data['settings']['notifications'][1]['replyto'] = ! empty( $settings->form_data['settings']['notification_replyto'] ) ? $settings->form_data['settings']['notification_replyto'] : '';
  52. }
  53. $id = 1;
  54. echo '<div class="wpforms-panel-content-section-title">';
  55. echo '<span id="wpforms-builder-settings-notifications-title">';
  56. esc_html_e( 'Notifications', 'wpforms-lite' );
  57. echo '</span>';
  58. echo '<button class="wpforms-builder-settings-block-add education-modal"
  59. data-utm-content="Multiple notifications"
  60. data-name="' . esc_attr__( 'Multiple notifications', 'wpforms-lite' ) . '">';
  61. esc_html_e( 'Add New Notification', 'wpforms-lite' );
  62. echo '</button>';
  63. echo '</div>';
  64. $dismissed = get_user_meta( get_current_user_id(), 'wpforms_dismissed', true );
  65. if ( empty( $dismissed['edu-builder-notifications-description'] ) ) {
  66. echo '<div class="wpforms-panel-content-section-description wpforms-dismiss-container wpforms-dismiss-out">';
  67. echo '<button type="button" class="wpforms-dismiss-button" title="' . esc_attr__( 'Dismiss this message.', 'wpforms-lite' ) . '" data-section="builder-notifications-description"></button>';
  68. echo '<p>';
  69. printf(
  70. wp_kses( /* translators: %s - Link to the WPForms.com doc article. */
  71. __( 'Notifications are emails sent when a form is submitted. By default, these emails include entry details. For setup and customization options, including a video overview, please <a href="%s" target="_blank" rel="noopener noreferrer">see our tutorial</a>.', 'wpforms-lite' ),
  72. [
  73. 'a' => [
  74. 'href' => [],
  75. 'rel' => [],
  76. 'target' => [],
  77. ],
  78. ]
  79. ),
  80. 'https://wpforms.com/docs/setup-form-notification-wpforms/'
  81. );
  82. echo '</p>';
  83. echo '<p>';
  84. printf(
  85. wp_kses( /* translators: 1$s, %2$s - Links to the WPForms.com doc articles. */
  86. __( 'After saving these settings, be sure to <a href="%1$s" target="_blank" rel="noopener noreferrer">test a form submission</a>. This lets you see how emails will look, and to ensure that<br>they <a href="%2$s" target="_blank" rel="noopener noreferrer">are delivered successfully</a>.', 'wpforms-lite' ),
  87. [
  88. 'a' => [
  89. 'href' => [],
  90. 'rel' => [],
  91. 'target' => [],
  92. ],
  93. 'br' => [],
  94. ]
  95. ),
  96. 'https://wpforms.com/docs/how-to-properly-test-your-wordpress-forms-before-launching-checklist/',
  97. 'https://wpforms.com/docs/troubleshooting-email-notifications/'
  98. );
  99. echo '</p>';
  100. echo '</div>';
  101. }
  102. wpforms_panel_field(
  103. 'toggle',
  104. 'settings',
  105. 'notification_enable',
  106. $settings->form_data,
  107. esc_html__( 'Enable Notifications', 'wpforms-lite' )
  108. );
  109. ?>
  110. <div class="wpforms-notification wpforms-builder-settings-block">
  111. <div class="wpforms-builder-settings-block-header">
  112. <span><?php esc_html_e( 'Default Notification', 'wpforms-lite' ); ?></span>
  113. </div>
  114. <div class="wpforms-builder-settings-block-content">
  115. <?php
  116. wpforms_panel_field(
  117. 'text',
  118. 'notifications',
  119. 'email',
  120. $settings->form_data,
  121. esc_html__( 'Send To Email Address', 'wpforms-lite' ),
  122. [
  123. 'default' => '{admin_email}',
  124. 'tooltip' => esc_html__( 'Enter the email address to receive form entry notifications. For multiple notifications, separate email addresses with a comma.', 'wpforms-lite' ),
  125. 'smarttags' => [
  126. 'type' => 'fields',
  127. 'fields' => 'email',
  128. ],
  129. 'parent' => 'settings',
  130. 'subsection' => $id,
  131. 'class' => 'email-recipient',
  132. ]
  133. );
  134. if ( $cc ) :
  135. wpforms_panel_field(
  136. 'text',
  137. 'notifications',
  138. 'carboncopy',
  139. $settings->form_data,
  140. esc_html__( 'CC', 'wpforms-lite' ),
  141. [
  142. 'smarttags' => [
  143. 'type' => 'fields',
  144. 'fields' => 'email',
  145. ],
  146. 'parent' => 'settings',
  147. 'subsection' => $id,
  148. ]
  149. );
  150. endif;
  151. wpforms_panel_field(
  152. 'text',
  153. 'notifications',
  154. 'subject',
  155. $settings->form_data,
  156. esc_html__( 'Email Subject Line', 'wpforms-lite' ),
  157. [
  158. /* translators: %s - form name. */
  159. 'default' => sprintf( esc_html__( 'New Entry: %s', 'wpforms-lite' ), $settings->form->post_title ),
  160. 'smarttags' => [
  161. 'type' => 'all',
  162. ],
  163. 'parent' => 'settings',
  164. 'subsection' => $id,
  165. ]
  166. );
  167. wpforms_panel_field(
  168. 'text',
  169. 'notifications',
  170. 'sender_name',
  171. $settings->form_data,
  172. esc_html__( 'From Name', 'wpforms-lite' ),
  173. [
  174. 'default' => sanitize_text_field( get_option( 'blogname' ) ),
  175. 'smarttags' => [
  176. 'type' => 'fields',
  177. 'fields' => 'name,text',
  178. ],
  179. 'parent' => 'settings',
  180. 'subsection' => $id,
  181. 'readonly' => ! empty( $from_name_after ),
  182. 'after' => ! empty( $from_name_after ) ? '<p class="note">' . $from_name_after . '</p>' : '',
  183. ]
  184. );
  185. wpforms_panel_field(
  186. 'text',
  187. 'notifications',
  188. 'sender_address',
  189. $settings->form_data,
  190. esc_html__( 'From Email', 'wpforms-lite' ),
  191. [
  192. 'default' => '{admin_email}',
  193. 'smarttags' => [
  194. 'type' => 'fields',
  195. 'fields' => 'email',
  196. ],
  197. 'parent' => 'settings',
  198. 'subsection' => $id,
  199. 'readonly' => ! empty( $from_email_after ),
  200. 'after' => ! empty( $from_email_after ) ? '<p class="note">' . $from_email_after . '</p>' : '',
  201. ]
  202. );
  203. wpforms_panel_field(
  204. 'text',
  205. 'notifications',
  206. 'replyto',
  207. $settings->form_data,
  208. esc_html__( 'Reply-To Email Address', 'wpforms-lite' ),
  209. [
  210. 'smarttags' => [
  211. 'type' => 'fields',
  212. 'fields' => 'email',
  213. ],
  214. 'parent' => 'settings',
  215. 'subsection' => $id,
  216. ]
  217. );
  218. wpforms_panel_field(
  219. 'textarea',
  220. 'notifications',
  221. 'message',
  222. $settings->form_data,
  223. esc_html__( 'Email Message', 'wpforms-lite' ),
  224. [
  225. 'rows' => 6,
  226. 'default' => '{all_fields}',
  227. 'smarttags' => [
  228. 'type' => 'all',
  229. ],
  230. 'parent' => 'settings',
  231. 'subsection' => $id,
  232. 'class' => 'email-msg',
  233. 'after' => '<p class="note">' .
  234. sprintf(
  235. /* translators: %s - {all_fields} Smart Tag. */
  236. esc_html__( 'To display all form fields, use the %s Smart Tag.', 'wpforms-lite' ),
  237. '<code>{all_fields}</code>'
  238. ) .
  239. '</p>',
  240. ]
  241. );
  242. ?>
  243. </div>
  244. </div>
  245. <?php
  246. do_action( 'wpforms_builder_settings_notifications_after', 'notifications', $settings );
  247. }
  248. /**
  249. * Lite admin scripts and styles.
  250. *
  251. * @since 1.5.7
  252. */
  253. public function admin_enqueues() {
  254. if ( ! wpforms_is_admin_page() ) {
  255. return;
  256. }
  257. $min = wpforms_get_min_suffix();
  258. // Admin styles.
  259. wp_enqueue_style(
  260. 'wpforms-lite-admin',
  261. WPFORMS_PLUGIN_URL . "lite/assets/css/admin{$min}.css",
  262. array(),
  263. WPFORMS_VERSION
  264. );
  265. }
  266. /**
  267. * Form confirmation settings, supports multiple confirmations.
  268. *
  269. * @since 1.4.8
  270. *
  271. * @param WPForms_Builder_Panel_Settings $settings Builder panel settings.
  272. */
  273. public function form_settings_confirmations( $settings ) {
  274. wp_enqueue_editor();
  275. // Handle backwards compatibility.
  276. if ( empty( $settings->form_data['settings']['confirmations'] ) ) {
  277. $settings->form_data['settings']['confirmations'][1]['type'] = ! empty( $settings->form_data['settings']['confirmation_type'] ) ? $settings->form_data['settings']['confirmation_type'] : 'message';
  278. $settings->form_data['settings']['confirmations'][1]['message'] = ! empty( $settings->form_data['settings']['confirmation_message'] ) ? $settings->form_data['settings']['confirmation_message'] : esc_html__( 'Thanks for contacting us! We will be in touch with you shortly.', 'wpforms-lite' );
  279. $settings->form_data['settings']['confirmations'][1]['message_scroll'] = ! empty( $settings->form_data['settings']['confirmation_message_scroll'] ) ? $settings->form_data['settings']['confirmation_message_scroll'] : 1;
  280. $settings->form_data['settings']['confirmations'][1]['page'] = ! empty( $settings->form_data['settings']['confirmation_page'] ) ? $settings->form_data['settings']['confirmation_page'] : '';
  281. $settings->form_data['settings']['confirmations'][1]['redirect'] = ! empty( $settings->form_data['settings']['confirmation_redirect'] ) ? $settings->form_data['settings']['confirmation_redirect'] : '';
  282. }
  283. $field_id = 1;
  284. echo '<div class="wpforms-panel-content-section-title">';
  285. esc_html_e( 'Confirmations', 'wpforms-lite' );
  286. echo '<button class="wpforms-builder-settings-block-add education-modal"
  287. data-utm-content="Multiple confirmations"
  288. data-name="' . esc_attr__( 'Multiple confirmations', 'wpforms-lite' ) . '">';
  289. esc_html_e( 'Add New Confirmation', 'wpforms-lite' );
  290. echo '</button>';
  291. echo '</div>';
  292. ?>
  293. <div class="wpforms-confirmation wpforms-builder-settings-block">
  294. <div class="wpforms-builder-settings-block-header">
  295. <span><?php esc_html_e( 'Default Confirmation', 'wpforms-lite' ); ?></span>
  296. </div>
  297. <div class="wpforms-builder-settings-block-content">
  298. <?php
  299. /**
  300. * Fires before each confirmation to add custom fields.
  301. *
  302. * @since 1.6.9
  303. *
  304. * @param WPForms_Builder_Panel_Settings $settings Builder panel settings.
  305. * @param int $field_id Field ID.
  306. */
  307. do_action( 'wpforms_lite_form_settings_confirmations_single_before', $settings, $field_id );
  308. wpforms_panel_field(
  309. 'select',
  310. 'confirmations',
  311. 'type',
  312. $settings->form_data,
  313. esc_html__( 'Confirmation Type', 'wpforms-lite' ),
  314. [
  315. 'default' => 'message',
  316. 'options' => [
  317. 'message' => esc_html__( 'Message', 'wpforms-lite' ),
  318. 'page' => esc_html__( 'Show Page', 'wpforms-lite' ),
  319. 'redirect' => esc_html__( 'Go to URL (Redirect)', 'wpforms-lite' ),
  320. ],
  321. 'class' => 'wpforms-panel-field-confirmations-type-wrap',
  322. 'input_class' => 'wpforms-panel-field-confirmations-type',
  323. 'parent' => 'settings',
  324. 'subsection' => $field_id,
  325. ]
  326. );
  327. wpforms_panel_field(
  328. 'textarea',
  329. 'confirmations',
  330. 'message',
  331. $settings->form_data,
  332. esc_html__( 'Confirmation Message', 'wpforms-lite' ),
  333. [
  334. 'default' => esc_html__( 'Thanks for contacting us! We will be in touch with you shortly.', 'wpforms-lite' ),
  335. 'tinymce' => [
  336. 'editor_height' => '200',
  337. ],
  338. 'input_id' => 'wpforms-panel-field-confirmations-message-' . $field_id,
  339. 'input_class' => 'wpforms-panel-field-confirmations-message',
  340. 'parent' => 'settings',
  341. 'subsection' => $field_id,
  342. 'class' => 'wpforms-panel-field-tinymce',
  343. 'smarttags' => [
  344. 'type' => 'all',
  345. ],
  346. ]
  347. );
  348. wpforms_panel_field(
  349. 'toggle',
  350. 'confirmations',
  351. 'message_scroll',
  352. $settings->form_data,
  353. esc_html__( 'Automatically scroll to the confirmation message', 'wpforms-lite' ),
  354. [
  355. 'input_class' => 'wpforms-panel-field-confirmations-message_scroll',
  356. 'parent' => 'settings',
  357. 'subsection' => $field_id,
  358. ]
  359. );
  360. $p = [];
  361. $pages = get_pages();
  362. foreach ( $pages as $page ) {
  363. $depth = count( $page->ancestors );
  364. $p[ $page->ID ] = str_repeat( '-', $depth ) . ' ' . $page->post_title;
  365. }
  366. wpforms_panel_field(
  367. 'select',
  368. 'confirmations',
  369. 'page',
  370. $settings->form_data,
  371. esc_html__( 'Confirmation Page', 'wpforms-lite' ),
  372. [
  373. 'options' => $p,
  374. 'input_class' => 'wpforms-panel-field-confirmations-page',
  375. 'parent' => 'settings',
  376. 'subsection' => $field_id,
  377. ]
  378. );
  379. wpforms_panel_field(
  380. 'text',
  381. 'confirmations',
  382. 'redirect',
  383. $settings->form_data,
  384. esc_html__( 'Confirmation Redirect URL', 'wpforms-lite' ),
  385. [
  386. 'input_class' => 'wpforms-panel-field-confirmations-redirect',
  387. 'parent' => 'settings',
  388. 'subsection' => $field_id,
  389. ]
  390. );
  391. /**
  392. * Fires after each confirmation to add custom fields.
  393. *
  394. * @since 1.6.9
  395. *
  396. * @param WPForms_Builder_Panel_Settings $settings Builder panel settings.
  397. * @param int $field_id Field ID.
  398. */
  399. do_action( 'wpforms_lite_form_settings_confirmations_single_after', $settings, $field_id );
  400. ?>
  401. </div>
  402. </div>
  403. <?php
  404. do_action( 'wpforms_builder_settings_confirmations_after', 'confirmations', $settings );
  405. }
  406. /**
  407. * Load assets for lite version with the admin builder.
  408. *
  409. * @since 1.0.0
  410. */
  411. public function builder_enqueues() {
  412. wp_enqueue_script(
  413. 'wpforms-builder-lite',
  414. WPFORMS_PLUGIN_URL . 'lite/assets/js/admin-builder-lite.js',
  415. array( 'jquery', 'jquery-confirm' ),
  416. WPFORMS_VERSION,
  417. false
  418. );
  419. $strings = array(
  420. 'disable_notifications' => sprintf(
  421. wp_kses( /* translators: %s - WPForms.com docs page URL. */
  422. __( 'You\'ve just turned off notification emails for this form. Since entries are not stored in WPForms Lite, notification emails are recommended for collecting entry details. For setup steps, <a href="%s" target="_blank" rel="noopener noreferrer">please see our notification tutorial</a>.', 'wpforms-lite' ),
  423. [
  424. 'a' => [
  425. 'href' => [],
  426. 'target' => [],
  427. 'rel' => [],
  428. ],
  429. ]
  430. ),
  431. 'https://wpforms.com/docs/setup-form-notification-wpforms/'
  432. ),
  433. );
  434. $strings = apply_filters( 'wpforms_lite_builder_strings', $strings );
  435. wp_localize_script(
  436. 'wpforms-builder-lite',
  437. 'wpforms_builder_lite',
  438. $strings
  439. );
  440. }
  441. /**
  442. * Display upgrade notice at the bottom on the plugin settings pages.
  443. *
  444. * @since 1.4.7
  445. *
  446. * @param string $view Current view inside the plugin settings page.
  447. */
  448. public function settings_cta( $view ) {
  449. if ( get_option( 'wpforms_lite_settings_upgrade', false ) || apply_filters( 'wpforms_lite_settings_upgrade', false ) ) {
  450. return;
  451. }
  452. ?>
  453. <div class="settings-lite-cta">
  454. <a href="#" class="dismiss" title="<?php esc_attr_e( 'Dismiss this message', 'wpforms-lite' ); ?>"><i class="fa fa-times-circle" aria-hidden="true"></i></a>
  455. <h5><?php esc_html_e( 'Get WPForms Pro and Unlock all the Powerful Features', 'wpforms-lite' ); ?></h5>
  456. <p><?php esc_html_e( 'Thanks for being a loyal WPForms Lite user. Upgrade to WPForms Pro to unlock all the awesome features and experience why WPForms is consistently rated the best WordPress form builder.', 'wpforms-lite' ); ?></p>
  457. <p>
  458. <?php
  459. printf(
  460. wp_kses( /* translators: %s - star icons. */
  461. __( 'We know that you will truly love WPForms. It has over 9000+ five star ratings (%s) and is active on over 5 million websites.', 'wpforms-lite' ),
  462. [
  463. 'i' => [
  464. 'class' => [],
  465. 'aria-hidden' => [],
  466. ],
  467. ]
  468. ),
  469. str_repeat( '<i class="fa fa-star" aria-hidden="true"></i>', 5 ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  470. );
  471. ?>
  472. </p>
  473. <h6><?php esc_html_e( 'Pro Features:', 'wpforms-lite' ); ?></h6>
  474. <div class="list">
  475. <ul>
  476. <li><?php esc_html_e( 'Entry Management - view all leads in one place', 'wpforms-lite' ); ?></li>
  477. <li><?php esc_html_e( 'All form features like file upload, pagination, etc', 'wpforms-lite' ); ?></li>
  478. <li><?php esc_html_e( 'Create surveys & polls with the surveys addon', 'wpforms-lite' ); ?></li>
  479. <li><?php esc_html_e( 'WordPress user registration and login forms', 'wpforms-lite' ); ?></li>
  480. <li><?php esc_html_e( 'Create payment forms with Stripe and PayPal', 'wpforms-lite' ); ?></li>
  481. </ul>
  482. <ul>
  483. <li><?php esc_html_e( 'Powerful Conditional Logic so you can create smart forms', 'wpforms-lite' ); ?></li>
  484. <li><?php esc_html_e( '500+ integrations with different marketing & payment services', 'wpforms-lite' ); ?></li>
  485. <li><?php esc_html_e( 'Collect signatures, geo-location data, and more', 'wpforms-lite' ); ?></li>
  486. <li><?php esc_html_e( 'Accept user submitted content with Post Submissions addon', 'wpforms-lite' ); ?></li>
  487. <li><?php esc_html_e( 'Bonus form templates, form abandonment, and more', 'wpforms-lite' ); ?></li>
  488. </ul>
  489. </div>
  490. <p>
  491. <a href="<?php echo esc_url( wpforms_admin_upgrade_link( 'settings-upgrade' ) ); ?>" target="_blank" rel="noopener noreferrer">
  492. <?php esc_html_e( 'Get WPForms Pro Today and Unlock all the Powerful Features »', 'wpforms-lite' ); ?>
  493. </a>
  494. </p>
  495. <p>
  496. <?php
  497. echo wp_kses(
  498. __( '<strong>Bonus:</strong> WPForms Lite users get <span class="green">50% off regular price</span>, automatically applied at checkout.', 'wpforms-lite' ),
  499. [
  500. 'strong' => [],
  501. 'span' => [
  502. 'class' => [],
  503. ],
  504. ]
  505. );
  506. ?>
  507. </p>
  508. </div>
  509. <script type="text/javascript">
  510. jQuery( function ( $ ) {
  511. $( document ).on( 'click', '.settings-lite-cta .dismiss', function ( event ) {
  512. event.preventDefault();
  513. $.post( ajaxurl, {
  514. action: 'wpforms_lite_settings_upgrade'
  515. } );
  516. $( '.settings-lite-cta' ).remove();
  517. } );
  518. } );
  519. </script>
  520. <?php
  521. }
  522. /**
  523. * Dismiss upgrade notice at the bottom on the plugin settings pages.
  524. *
  525. * @since 1.4.7
  526. */
  527. public function settings_cta_dismiss() {
  528. if ( ! wpforms_current_user_can() ) {
  529. wp_send_json_error();
  530. }
  531. update_option( 'wpforms_lite_settings_upgrade', time() );
  532. wp_send_json_success();
  533. }
  534. /**
  535. * Notify user that entries is a pro feature.
  536. *
  537. * @since 1.0.0
  538. */
  539. public function entries_page() {
  540. if ( ! isset( $_GET['page'] ) || 'wpforms-entries' !== $_GET['page'] ) {
  541. return;
  542. }
  543. ?>
  544. <style>
  545. .wpforms-admin-content {
  546. -webkit-filter: blur(3px);
  547. -moz-filter: blur(3px);
  548. -ms-filter: blur(3px);
  549. -o-filter: blur(3px);
  550. filter: blur(3px);
  551. }
  552. .wpforms-admin-content a {
  553. pointer-events: none;
  554. cursor: default;
  555. }
  556. .ie-detected {
  557. position: absolute;
  558. top: 0;
  559. width: 100%;
  560. height: 100%;
  561. left: 0;
  562. background-color: #f1f1f1;
  563. opacity: 0.65;
  564. z-index: 10;
  565. }
  566. .wpforms-admin-content,
  567. .wpforms-admin-content-wrap {
  568. position: relative;
  569. }
  570. .entries-modal {
  571. text-align: center;
  572. width: 730px;
  573. box-shadow: 0 0 60px 30px rgba(0, 0, 0, 0.15);
  574. border-radius: 3px;
  575. position: absolute;
  576. top: 75px;
  577. left: 50%;
  578. margin: 0 auto 0 -365px;
  579. z-index: 100;
  580. }
  581. .entries-modal *,
  582. .entries-modal *::before,
  583. .entries-modal *::after {
  584. -webkit-box-sizing: border-box;
  585. -moz-box-sizing: border-box;
  586. box-sizing: border-box;
  587. }
  588. .entries-modal h2 {
  589. font-size: 20px;
  590. margin: 0 0 16px 0;
  591. padding: 0;
  592. }
  593. .entries-modal p {
  594. font-size: 16px;
  595. color: #666;
  596. margin: 0 0 30px 0;
  597. padding: 0;
  598. }
  599. .entries-modal-content {
  600. background-color: #fff;
  601. border-radius: 3px 3px 0 0;
  602. padding: 40px;
  603. }
  604. .entries-modal ul {
  605. float: left;
  606. width: 50%;
  607. margin: 0;
  608. padding: 0 0 0 30px;
  609. text-align: left;
  610. }
  611. .entries-modal li {
  612. color: #666;
  613. font-size: 16px;
  614. padding: 6px 0;
  615. }
  616. .entries-modal li .fa {
  617. color: #2a9b39;
  618. margin: 0 8px 0 0;
  619. }
  620. .entries-modal-button {
  621. border-radius: 0 0 3px 3px;
  622. padding: 30px;
  623. background: #f5f5f5;
  624. text-align: center;
  625. }
  626. #wpforms-entries-list .entries .column-indicators > a {
  627. float: left;
  628. }
  629. </style>
  630. <script type="text/javascript">
  631. jQuery( function ( $ ) {
  632. var userAgent = window.navigator.userAgent,
  633. onlyIEorEdge = /msie\s|trident\/|edge\//i.test( userAgent ) && ! ! (document.uniqueID || window.MSInputMethodContext),
  634. checkVersion = (onlyIEorEdge && + (/(edge\/|rv:|msie\s)([\d.]+)/i.exec( userAgent )[ 2 ])) || NaN;
  635. if ( ! isNaN( checkVersion ) ) {
  636. $( '#ie-wrap' ).addClass( 'ie-detected' );
  637. }
  638. } );
  639. </script>
  640. <div id="wpforms-entries-list" class="wrap wpforms-admin-wrap">
  641. <h1 class="page-title">Entries</h1>
  642. <div class="wpforms-admin-content-wrap">
  643. <div class="entries-modal">
  644. <div class="entries-modal-content">
  645. <h2><?php esc_html_e( 'View and Manage All Your Form Entries inside WordPress', 'wpforms-lite' ); ?></h2>
  646. <p>
  647. <strong><?php esc_html_e( 'Form entries are not stored in WPForms Lite.', 'wpforms-lite' ); ?></strong><br>
  648. <?php esc_html_e( 'Once you upgrade to WPForms Pro, all future form entries will be stored in your WordPress database and displayed on this Entries screen.', 'wpforms-lite' ); ?>
  649. </p>
  650. <div class="wpforms-clear">
  651. <ul class="left">
  652. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'View Entries in Dashboard', 'wpforms-lite' ); ?></li>
  653. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Export Entries in a CSV File', 'wpforms-lite' ); ?></li>
  654. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Add Notes / Comments', 'wpforms-lite' ); ?></li>
  655. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Save Favorite Entries', 'wpforms-lite' ); ?></li>
  656. </ul>
  657. <ul class="right">
  658. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Mark Read / Unread', 'wpforms-lite' ); ?></li>
  659. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Print Entries', 'wpforms-lite' ); ?></li>
  660. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'Resend Notifications', 'wpforms-lite' ); ?></li>
  661. <li><i class="fa fa-check" aria-hidden="true"></i> <?php esc_html_e( 'See Geolocation Data', 'wpforms-lite' ); ?></li>
  662. </ul>
  663. </div>
  664. </div>
  665. <div class="entries-modal-button">
  666. <a href="<?php echo esc_url( wpforms_admin_upgrade_link( 'entries' ) ); ?>" class="wpforms-btn wpforms-btn-lg wpforms-btn-orange wpforms-upgrade-modal" target="_blank" rel="noopener noreferrer">
  667. <?php esc_html_e( 'Upgrade to WPForms Pro Now', 'wpforms-lite' ); ?>
  668. </a>
  669. <br>
  670. <p style="margin: 10px 0 0;font-style:italic;font-size: 13px;">and start collecting entries!</p>
  671. </div>
  672. </div>
  673. <div class="wpforms-admin-content">
  674. <div id="ie-wrap"></div>
  675. <div class="form-details wpforms-clear">
  676. <span class="form-details-sub">Select Form</span>
  677. <h3 class="form-details-title">
  678. Contact Us
  679. <div class="form-selector">
  680. <a href="#" title="Open form selector" class="toggle dashicons dashicons-arrow-down-alt2"></a>
  681. <div class="form-list" style="display: none;">
  682. <ul>
  683. <li></li>
  684. </ul>
  685. </div>
  686. </div>
  687. </h3>
  688. <div class="form-details-actions">
  689. <a href="#" class="form-details-actions-edit"><span class="dashicons dashicons-edit"></span> Edit This Form</a>
  690. <a href="#" class="form-details-actions-preview" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-visibility"></span> Preview Form</a>
  691. <a href="#" class="form-details-actions-export"><span class="dashicons dashicons-migrate"></span> Export All (CSV)</a>
  692. <a href="#" class="form-details-actions-read"><span class="dashicons dashicons-marker"></span> Mark All Read</a>
  693. </div>
  694. </div>
  695. <form id="wpforms-entries-table">
  696. <ul class="subsubsub">
  697. <li class="all"><a href="#" class="current">All&nbsp;<span class="count">(<span class="total-num">10</span>)</span></a> |</li>
  698. <li class="unread"><a href="#">Unread&nbsp;<span class="count">(<span class="unread-num">10</span>)</span></a> |</li>
  699. <li class="starred"><a href="#">Starred&nbsp;<span class="count">(<span class="starred-num">0</span>)</span></a></li>
  700. </ul>
  701. <div class="tablenav top">
  702. <div class="alignleft actions bulkactions">
  703. <label for="bulk-action-selector-top" class="screen-reader-text">Select bulk action</label>
  704. <select name="action" id="bulk-action-selector-top">
  705. <option value="-1">Bulk Actions</option>
  706. </select>
  707. <input type="submit" id="doaction" class="button action" value="Apply">
  708. </div>
  709. <div class="tablenav-pages one-page">
  710. <span class="displaying-num">10 items</span>
  711. <span class="pagination-links">
  712. <span class="tablenav-pages-navspan" aria-hidden="true">«</span>
  713. <span class="tablenav-pages-navspan" aria-hidden="true">‹</span>
  714. <span class="paging-input">
  715. <label for="current-page-selector" class="screen-reader-text">Current Page</label>
  716. <input class="current-page" id="current-page-selector" type="text" name="paged" value="1" size="1" aria-describedby="table-paging">
  717. <span class="tablenav-paging-text"> of <span class="total-pages">1</span></span>
  718. </span>
  719. <span class="tablenav-pages-navspan" aria-hidden="true">›</span>
  720. <span class="tablenav-pages-navspan" aria-hidden="true">»</span>
  721. </span>
  722. </div>
  723. <br class="clear">
  724. </div>
  725. <table class="wp-list-table widefat fixed striped entries">
  726. <thead>
  727. <tr>
  728. <td id="cb" class="manage-column column-cb check-column">
  729. <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
  730. <input id="cb-select-all-1" type="checkbox">
  731. </td>
  732. <th scope="col" id="indicators" class="manage-column column-indicators column-primary"></th>
  733. <th scope="col" id="wpforms_field_0" class="manage-column column-wpforms_field_0">Name</th>
  734. <th scope="col" id="wpforms_field_1" class="manage-column column-wpforms_field_1">Email</th>
  735. <th scope="col" id="wpforms_field_2" class="manage-column column-wpforms_field_2">Comment or Message</th>
  736. <th scope="col" id="date" class="manage-column column-date sortable desc">
  737. <a href="#"><span>Date</span><span class="sorting-indicator"></span></a>
  738. </th>
  739. <th scope="col" id="actions" class="manage-column column-actions">Actions</th>
  740. </tr>
  741. </thead>
  742. <tbody id="the-list" data-wp-lists="list:entry">
  743. <tr>
  744. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1088"></th>
  745. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  746. <a href="#" class="indicator-star star" data-id="1088" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  747. <a href="#" class="indicator-read read" data-id="1088" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  748. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  749. </td>
  750. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">David Wells</td>
  751. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">DavidMWells@example.com</td>
  752. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  753. Vivamus sit amet dolor arcu. Praesent fermentum semper justo, nec scelerisq…
  754. </td>
  755. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  756. <td class="actions column-actions" data-colname="Actions">
  757. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  758. </td>
  759. </tr>
  760. <tr>
  761. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1087"></th>
  762. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  763. <a href="#" class="indicator-star star" data-id="1087" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  764. <a href="#" class="indicator-read read" data-id="1087" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  765. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  766. </td>
  767. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Jennifer Selzer</td>
  768. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">JenniferLSelzer@example.com</td>
  769. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  770. Maecenas sollicitudin felis et justo elementum, et lobortis justo vulputate…
  771. </td>
  772. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  773. <td class="actions column-actions" data-colname="Actions">
  774. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  775. </td>
  776. </tr>
  777. <tr>
  778. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1086"></th>
  779. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  780. <a href="#" class="indicator-star star" data-id="1086" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  781. <a href="#" class="indicator-read read" data-id="1086" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  782. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  783. </td>
  784. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Philip Norton</td>
  785. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">PhilipTNorton@example.com</td>
  786. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  787. Etiam cursus orci tellus, ut vehicula odio mattis sit amet. Curabitur eros …
  788. </td>
  789. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  790. <td class="actions column-actions" data-colname="Actions">
  791. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  792. </td>
  793. </tr>
  794. <tr>
  795. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1085"></th>
  796. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  797. <a href="#" class="indicator-star star" data-id="1085" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  798. <a href="#" class="indicator-read read" data-id="1085" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  799. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  800. </td>
  801. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Kevin Gregory</td>
  802. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">KevinJGregory@example.com</td>
  803. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  804. Cras vel orci congue, tincidunt eros vitae, consectetur risus. Proin enim m…
  805. </td>
  806. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  807. <td class="actions column-actions" data-colname="Actions">
  808. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  809. </td>
  810. </tr>
  811. <tr>
  812. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1084"></th>
  813. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  814. <a href="#" class="indicator-star star" data-id="1084" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  815. <a href="#" class="indicator-read read" data-id="1084" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  816. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  817. </td>
  818. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">John Heiden</td>
  819. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">JohnCHeiden@example.com</td>
  820. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  821. Fusce consequat dui ut orci tempus cursus. Vivamus ut neque id ipsum tempor…
  822. </td>
  823. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  824. <td class="actions column-actions" data-colname="Actions">
  825. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  826. </td>
  827. </tr>
  828. <tr>
  829. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1083"></th>
  830. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  831. <a href="#" class="indicator-star star" data-id="1083" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  832. <a href="#" class="indicator-read read" data-id="1083" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  833. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  834. </td>
  835. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Laura Shuler</td>
  836. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">LauraDShuler@example.com</td>
  837. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  838. In ac finibus erat. Curabitur sit amet ante nec tellus commodo commodo non …
  839. </td>
  840. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  841. <td class="actions column-actions" data-colname="Actions">
  842. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  843. </td>
  844. </tr>
  845. <tr>
  846. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1082"></th>
  847. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  848. <a href="#" class="indicator-star star" data-id="1082" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  849. <a href="#" class="indicator-read read" data-id="1082" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  850. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  851. </td>
  852. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Walter Sullivan</td>
  853. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">WalterPSullivan@example.com</td>
  854. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  855. Phasellus semper magna leo, ut porta nibh pretium sed. Interdum et malesuad…
  856. </td>
  857. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  858. <td class="actions column-actions" data-colname="Actions">
  859. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  860. </td>
  861. </tr>
  862. <tr>
  863. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1081"></th>
  864. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  865. <a href="#" class="indicator-star star" data-id="1081" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  866. <a href="#" class="indicator-read read" data-id="1081" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  867. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  868. </td>
  869. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Gary Austin</td>
  870. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">GaryJAustin@example.com</td>
  871. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  872. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet ero…
  873. </td>
  874. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  875. <td class="actions column-actions" data-colname="Actions">
  876. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  877. </td>
  878. </tr>
  879. <tr>
  880. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1080"></th>
  881. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  882. <a href="#" class="indicator-star star" data-id="1080" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  883. <a href="#" class="indicator-read read" data-id="1080" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  884. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  885. </td>
  886. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Mark Frahm</td>
  887. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">MarkTFrahm@example.com</td>
  888. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  889. Proin euismod tellus quis tortor bibendum, a pulvinar libero fringilla. Cur…
  890. </td>
  891. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  892. <td class="actions column-actions" data-colname="Actions">
  893. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  894. </td>
  895. </tr>
  896. <tr>
  897. <th scope="row" class="check-column"><input type="checkbox" name="entry_id[]" value="1079"></th>
  898. <td class="indicators column-indicators has-row-actions column-primary" data-colname="">
  899. <a href="#" class="indicator-star star" data-id="1079" title="Star entry"><span class="dashicons dashicons-star-filled"></span></a>
  900. <a href="#" class="indicator-read read" data-id="1079" title="Mark entry read"><span class="dashicons dashicons-marker"></span></a>
  901. <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
  902. </td>
  903. <td class="wpforms_field_0 column-wpforms_field_0" data-colname="Name">Linda Reynolds</td>
  904. <td class="wpforms_field_1 column-wpforms_field_1" data-colname="Email">LindaJReynolds@example.com</td>
  905. <td class="wpforms_field_2 column-wpforms_field_2" data-colname="Comment or Message">
  906. Cras sodales sagittis maximus. Nunc vestibulum orci quis orci pulvinar vulp…
  907. </td>
  908. <td class="date column-date" data-colname="Date">July 27, 2017</td>
  909. <td class="actions column-actions" data-colname="Actions">
  910. <a href="#" title="View Form Entry" class="view">View</a> <span class="sep">|</span> <a href="#" title="Delete Form Entry" class="delete">Delete</a>
  911. </td>
  912. </tr>
  913. </tbody>
  914. <tfoot>
  915. <tr>
  916. <td class="manage-column column-cb check-column">
  917. <label class="screen-reader-text" for="cb-select-all-2">Select All</label>
  918. <input id="cb-select-all-2" type="checkbox">
  919. </td>
  920. <th scope="col" class="manage-column column-indicators column-primary"></th>
  921. <th scope="col" class="manage-column column-wpforms_field_0">Name</th>
  922. <th scope="col" class="manage-column column-wpforms_field_1">Email</th>
  923. <th scope="col" class="manage-column column-wpforms_field_2">Comment or Message</th>
  924. <th scope="col" class="manage-column column-date sortable desc">
  925. <a href="#"><span>Date</span><span class="sorting-indicator"></span></a>
  926. </th>
  927. <th scope="col" class="manage-column column-actions">Actions</th>
  928. </tr>
  929. </tfoot>
  930. </table>
  931. </form>
  932. </div>
  933. </div>
  934. </div>
  935. <div class="clear"></div>
  936. <?php
  937. }
  938. /**
  939. * Add appropriate styling to addons page.
  940. *
  941. * @since 1.0.4
  942. * @deprecated 1.6.7
  943. */
  944. public function addon_page_enqueues() {
  945. _deprecated_function( __CLASS__ . '::' . __METHOD__, '1.6.7 of WPForms plugin', "wpforms()->get( 'addons_page' )->enqueues()" );
  946. wpforms()->get( 'addons_page' )->enqueues();
  947. }
  948. /**
  949. * Addons page.
  950. *
  951. * @since 1.0.0
  952. * @deprecated 1.6.7
  953. */
  954. public function addons_page() {
  955. _deprecated_function( __CLASS__ . '::' . __METHOD__, '1.6.7 of WPForms plugin', "wpforms()->get( 'addons_page' )->output()" );
  956. if ( ! wpforms_is_admin_page( 'addons' ) ) {
  957. return;
  958. }
  959. wpforms()->get( 'addons_page' )->output();
  960. }
  961. /**
  962. * Increase entries count once a form is submitted.
  963. *
  964. * @since 1.5.9
  965. *
  966. * @param array $fields Set of form fields.
  967. * @param array $entry Entry contents.
  968. * @param int|string $form_id Form ID.
  969. */
  970. public function update_entry_count( $fields, $entry, $form_id ) {
  971. global $wpdb;
  972. if ( ! apply_filters( 'wpforms_dash_widget_allow_entries_count_lite', true ) ) {
  973. return;
  974. }
  975. $form_id = absint( $form_id );
  976. if ( empty( $form_id ) ) {
  977. return;
  978. }
  979. if ( add_post_meta( $form_id, 'wpforms_entries_count', 1, true ) ) {
  980. return;
  981. }
  982. // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching
  983. $wpdb->query(
  984. $wpdb->prepare(
  985. "UPDATE {$wpdb->postmeta}
  986. SET meta_value = meta_value + 1
  987. WHERE post_id = %d AND meta_key = 'wpforms_entries_count'",
  988. $form_id
  989. )
  990. );
  991. }
  992. /**
  993. * Add Lite-specific templates to the list of searchable template paths.
  994. *
  995. * @since 1.6.6
  996. *
  997. * @param array $paths Paths to templates.
  998. *
  999. * @return array
  1000. */
  1001. public function add_templates( $paths ) {
  1002. $paths = (array) $paths;
  1003. $paths[102] = trailingslashit( __DIR__ . '/templates' );
  1004. return $paths;
  1005. }
  1006. }
  1007. new WPForms_Lite();