These days, WordPress powered sites ranges from simple static websites to complex dynamic web applications. WordPress offers great built-in features for providing content for users, allowing the site owners to publish dynamic content from the back end. Getting users to interact with the website is another vital aspect of building successful websites. Therefore, we need ways to let users interact with the site. WordPress forms plugins are the standout solution for retrieving dynamic content from users.
如今,WordPress驱动的网站范围从简单的静态网站到复杂的动态Web应用程序。 WordPress提供了出色的内置功能,可为用户提供内容,从而使网站所有者可以从后端发布动态内容。 让用户与网站互动是构建成功网站的另一个重要方面。 因此,我们需要让用户与网站互动的方法。 WordPress表单插件是从用户检索动态内容的出色解决方案。
In this article, we are going to talk about how forms plugins fit into WordPress and how you can build the perfect forms plugins as a developer. So this article is intended for users who are planning to improve their WordPress site with dynamic content as well as for developers who want to build a perfect forms plugin for maximum profits.
在本文中,我们将讨论表单插件如何适合WordPress,以及如何以开发人员的身份构建完美的表单插件。 因此,本文适用于计划通过动态内容改善其WordPress网站的用户,以及希望构建完美表单插件以获取最大利润的开发人员。
Let’s get started.
让我们开始吧。
In simple terms, forms plugins lets you create dynamic forms to be embedded in the front end of your site. Once enabled, users have the ability to populate forms with dynamic content and submit them to the site administrator. As an authorized user, you have the ability to see all the data provided by users. Generally, site owners with less technical knowledge will find these plugins very useful as they can create advanced features without worrying about programming or technical stuff.
简而言之,表单插件使您可以创建要嵌入到站点前端的动态表单。 启用后,用户可以使用动态内容填充表单并将其提交给站点管理员。 作为授权用户,您可以查看用户提供的所有数据。 通常,技术知识较少的网站所有者会发现这些插件非常有用,因为他们可以创建高级功能而不必担心编程或技术问题。
WordPress forms plugins break the barrier in creating advanced data retrieval techniques for non-technical users.
WordPress表单插件打破了为非技术用户创建高级数据检索技术的障碍。
Now you might have a very basic understanding about a forms plugin and its role. Let’s dig deeper into the concept of forms plugin by looking at some of the most popular forms plugins for WordPress.
现在,您可能对表单插件及其作用有了非常基本的了解。 让我们通过查看一些最流行的WordPress表单插件来深入了解表单插件的概念。
There are a substantial number of WordPress forms plugins available, in both free and premium versions. Even though each of these plugins works differently, the main features are the same across all the plugins. In this article, I am going to look at four different plugins in both free and premium category. Let’s get a quick introduction to these four plugins.
有大量可用的WordPress表单插件,有免费版本和高级版本。 即使每个插件的工作方式不同,所有插件的主要功能也相同。 在本文中,我将研究免费和高级类别中的四个不同的插件。 让我们快速介绍这四个插件。
Visual Form Builder – (Free)
可视表单生成器 –(免费)
Ninja Forms – (Free)
忍者形式 –(免费)
Gravity Forms – (Premium)
重力形式 –(高级)
Formidable Forms – (Free and Premium)
强大的表格 -(免费和高级)
Before we go any further, you can download and install these four plugins and see how they work and the available features within the provided screens. Note that you can check all of these plugins for free, apart from Gravity Forms.
在继续进行操作之前,您可以下载并安装这四个插件,并在提供的屏幕中查看它们的工作方式和可用功能。 请注意,除了Gravity Forms之外,您可以免费检查所有这些插件。
I highly recommend you do this task if you want to develop a perfect forms plugin and use it in your site for advanced functionalities. Now let’s figure out the common usages of forms plugins.
如果您要开发一个完美的表单插件并将其用于站点中的高级功能,我强烈建议您执行此任务。 现在,让我们找出表单插件的常见用法。
Integrating an advanced contact form is the most noticeable use of WordPress forms plugins. Most of these plugins contain Contact Form in their name or within the main description, proving that its the main purpose of these plugins. However, there are some common usages apart from building contact forms. Let’s look a t few of those scenarios.
集成高级联系人表单是WordPress表单插件最引人注目的用途。 这些插件中的大多数在其名称或主要描述中均包含联系表,证明其是这些插件的主要用途。 但是,除了建立联系表之外,还有一些常用用法。 让我们看看其中一些情况。
WordPress provides a built-in comment form and all existing themes provides this feature by default. But there are occasions where we need more advanced comment forms to categorize the user feedback and get more information. In such cases, it’s easy to use a forms plugin rather than modifying the existing comment form by changing theme code.
WordPress提供了一个内置的注释表单,默认情况下所有现有主题都提供此功能。 但是在某些情况下,我们需要更高级的评论表单来对用户反馈进行分类并获取更多信息。 在这种情况下,使用表单插件而不是通过更改主题代码来修改现有注释表单很容易。
Forms plugins are also used to receive orders from users on websites selling products. We can create a form to select the products and submit the orders. Once submitted users will get a notification and site admin will process the order manually from the back end.
表单插件还用于在销售产品的网站上接收用户的订单。 我们可以创建一个表格来选择产品并提交订单。 提交的用户一旦收到通知,站点管理员将从后端手动处理订单。
Polls are a prominent technique for getting user feedback from a limited set of answers. Forms plugins can be easily configured to create polls and check the results from the back end.
轮询是一种从有限的一组答案中获取用户反馈的杰出技术。 可以轻松配置Forms插件以创建民意调查并从后端检查结果。
Generally, users need to log in to WordPress admin area to create posts. However, there are occasions that allows users to submit content to the database without logging in. Front end posting is a commonly used technique where users are allowed to create content from the front end of the website by filling in a form. Forms plugins can easily be used to simplify the front end posting process.
通常,用户需要登录WordPress管理区域来创建帖子。 但是,在某些情况下,允许用户无需登录即可将内容提交到数据库。前端发布是一种常用的技术,允许用户通过填写表单从网站的前端创建内容。 表单插件可轻松用于简化前端发布过程。
You may have noticed that most of these features allows users to submit the form and get a notification. Basically, this is a one way process where users submit the form data and an administrator manually processes it. Once the data is submitted, the process ends for the user. So this is where we can improve our plugin to continue the process by reducing the manual tasks done in the admin side. We’ll talk more about this later on in “Making Your Plugin Stand Out from the Rest”.
您可能已经注意到,大多数这些功能都允许用户提交表单并获得通知。 基本上,这是一种单向过程,其中用户提交表单数据,而管理员则手动处理它。 提交数据后,该过程将为用户结束。 因此,在这里我们可以通过减少在管理端完成的手动任务来改进插件以继续该过程。 我们将在稍后的“让您的插件脱颖而出”中进一步讨论。
Now we have all the ingredients to plan the features of a perfect forms plugin. In the next section, we are going to discuss the planning process.
现在,我们拥有了计划完美表单插件功能的所有要素。 在下一节中,我们将讨论计划过程。
Identifying and planning the requirements is the first and most important task of any development project. There are plenty of plugins available for creating forms with WordPress. Unless we plan properly, we are not going to be anywhere near a perfect plugin that can challenge the existing ones.
识别和计划需求是任何开发项目的首要也是最重要的任务。 有很多可用于使用WordPress创建表单的插件。 除非我们进行适当的计划,否则我们将不会靠近可以挑战现有插件的完美插件。
Let’s consider the most basic steps in planning such a plugin.
让我们考虑规划此类插件的最基本步骤。
Simplicity is the trend in modern web designing, which allows us to catch the eye of potentials users. If you research for best themes, you will find that most popular themes are the ones with very minimal and clean designs. Some people create designs with very high quality graphics and many colors to impress the users. But soon they realize the mistake and switches back to minimal designs to suit the widest range of users. So make sure to design the plugin layout as simply as possible.
简单性是现代网页设计的趋势,它使我们能够吸引潜在用户的注意。 如果您研究最佳主题,就会发现最受欢迎的主题是设计极少且简洁的主题。 有些人用非常高质量的图形和许多颜色创建设计,以打动用户。 但是不久,他们意识到了这一错误,并切换回最小的设计以适应最广泛的用户。 因此,请确保尽可能简单地设计插件布局。
Users want to do things as quickly as possible, while developers usually want to provide as many features as possible. This is the breaking point where users decide to use the plugin or look for an alternative plugin. As developers, we have to find ways to present all the available features in a simple, user friendly manner. Registration forms can considered a very good example to illustrate this point. A few years ago, we had registration forms with very large number of fields. Later registration form fields were distributed across several steps to make the process simpler. These days we only have maximum of 2-3 fields or social logins to register as a member. So we need to reduce the amount of steps required of creating and managing forms within our plugin.
用户希望尽快执行操作,而开发人员通常希望提供尽可能多的功能。 这是用户决定使用该插件或寻找替代插件的突破点。 作为开发人员,我们必须找到以简单,用户友好的方式呈现所有可用功能的方法。 注册表格可以被视为说明这一点的一个很好的例子。 几年前,我们有很多领域的注册表格。 以后的注册表单字段分布在多个步骤中,以简化流程。 这些天,我们最多只能有2-3个字段或社交登录才能注册为会员。 因此,我们需要减少在插件中创建和管理表单所需的步骤。
There are developers who uses fancy third party plugins to create the features in a forms plugin, hoping that they can stand out from the competitors. But the truth is that these types of plugins create more conflicts with the existing theme and plugins within your WordPress application. WordPress provides the support for features such as drag and drop, data grids, file uploads within its core and these should be used in every possible scenario. Also it standardizes the features, making it easy for users to switch from one plugin to another. When you are developing a new plugin, make sure to use the existing WordPress features and functions to their maximum capabilities to provide flexible solution.
有些开发人员使用精美的第三方插件在表单插件中创建功能,希望它们能在竞争者中脱颖而出。 但事实是,这些类型的插件会与WordPress应用程序中的现有主题和插件产生更多冲突。 WordPress在其核心内提供对拖放,数据网格,文件上传等功能的支持,这些功能应在所有可能的情况下使用。 它还使功能标准化,使用户可以轻松地从一个插件切换到另一个插件。 在开发新插件时,请确保使用现有的WordPress特性和功能以发挥其最大功能,以提供灵活的解决方案。
Generally, all WordPress form plugins have a set of features common across all the plugins. It’s important to have the mandatory set of features to compete with other plugins.
通常,所有WordPress表单插件都具有所有插件共有的一组功能。 具有强制性功能集以与其他插件竞争很重要。
In the next section, we are going to look at these mandatory features in detail.
在下一节中,我们将详细介绍这些强制性功能。
As developers, we don’t have to reinvent the wheel to create a forms plugin. First, we have to conduct a proper research on existing plugins to identify the fundamental features. Once we have a sound base with fundamental features, it’s straightforward to add new features to make the plugin unique. So let’s look at the fundamental features of forms plugins by comparing the four plugins introduced earlier.
作为开发人员,我们无需重新发明轮子来创建表单插件。 首先,我们必须对现有插件进行适当的研究,以识别基本功能。 一旦我们有了具有基本功能的基础,就可以直接添加新功能以使插件具有独特性。 因此,通过比较前面介绍的四个插件,让我们看一下表单插件的基本功能。
Form creation is the main functionality of a forms plugin. Generally, these type of plugins provide dynamic field types to create forms using drag and drop effect. Consider the previous screenshots of these four plugins for available field types.
表单创建是表单插件的主要功能。 通常,这些类型的插件提供动态字段类型,以使用拖放效果创建表单。 考虑这四个插件的先前屏幕截图,以了解可用的字段类型。
As you may notice, most forms plugins has a set of basic fields such as Textbox, Textarea, Checkboxes, HTML etc while having a set of plugin-specific unique fields. Basically, we have to provide the support for all the basic HTML form field types in order to develop a plugin to match the features of any existing plugin. Then, we can decide on the advanced field types to make our plugin unique from the existing ones.
您可能会注意到,大多数表单插件都具有一组基本字段,例如Textbox,Textarea,Checkboxes,HTML等,同时具有一组特定于插件的唯一字段。 基本上,我们必须提供对所有基本HTML表单字段类型的支持,以便开发一个插件以匹配任何现有插件的功能。 然后,我们可以决定高级字段类型,以使我们的插件与现有插件保持唯一。
Once created, users should have a way to list all the available forms within the site. It’s important to use the existing WordPress data grid to keep the consistency with other plugins. The list should contain all the mandatory information and actions related to forms. Consider the following screenshot for form list in Formidable plugin. Other plugins contains similar screens for a form list.
创建后,用户应该可以列出网站中所有可用的表单。 使用现有的WordPress数据网格来保持与其他插件的一致性非常重要。 该列表应包含与表格有关的所有强制性信息和操作。 考虑以下屏幕截图,了解Formidable插件中的表单列表。 其他插件包含表单列表的类似屏幕。
As you can see, this plugin uses the existing data grid. Each entry in the form list has number of links to navigate to various options. Most common actions should be Edit, Delete, Settings and Duplicate. Also, these forms are integrated into pages or posts using a shortcode and hence it’s essential to display it inline with the forms.
如您所见,此插件使用现有的数据网格。 表单列表中的每个条目都有许多链接可导航到各种选项。 最常见的操作应该是“编辑”,“删除”,“设置”和“复制”。 而且,这些表单使用短代码集成到页面或帖子中,因此必须与表单内联显示。
Generally, users of WordPress websites have limited technical knowledge. So it’s difficult for them to understand the concept of shortcodes and assign parameters without making errors. Therefore, we need a simplified way to allow users to add forms into pages or posts. Most existing plugins provides this feature by adding a “new” button to the post editor. Consider the following screen for form generation button in post editor.
通常,WordPress网站的用户具有有限的技术知识。 因此,他们很难理解简码的概念并分配参数而不会出错。 因此,我们需要一种简化的方法来允许用户将表单添加到页面或帖子中。 大多数现有插件通过在帖子编辑器中添加“新”按钮来提供此功能。 考虑以下屏幕中的帖子编辑器中的表单生成按钮。
All form buttons are similar in nature where you are allowed to select the form from a dropdown menu and directly insert into the editor. We have to make the popup as simple as possible with only the mandatory options, so that users can quickly add new forms.
所有表单按钮本质上都是相似的,您可以从下拉菜单中选择表单并直接插入编辑器。 我们必须仅使用必需的选项使弹出窗口尽可能简单,以便用户可以快速添加新表单。
Once forms are inserted into the site, users can fill them with data and submit them. So the next major point in planning a forms plugins is to manage the submitted data and display in the back end of WordPress. Generally, we can use the WordPress admin list table to show the submitted entries in a data grid. The following screen contains a form entries list of Gravity Forms. You can find the link to entries section under each form in forms list.
将表单插入网站后,用户可以向其中填充数据并提交。 因此,计划表单插件的下一个重点是管理提交的数据并显示在WordPress的后端。 通常,我们可以使用WordPress管理员列表表在数据网格中显示已提交的条目。 以下屏幕包含重力表格的表格条目列表。 您可以在表单列表的每个表单下找到条目链接。
All the submitted entries are shown in a grid, allowing the administrator to take the necessary actions on the submitted data. Gravity Forms provides extended options for form entries by providing custom statuses called Mark as Read, Mark as Unread, Add Star, Remove star etc. You can make your plugin unique by adding more important actions for filtering form entries.
所有提交的条目都显示在一个网格中,从而允许管理员对提交的数据采取必要的操作。 Gravity Forms通过提供称为“标记为已读”,“标记为未读”,“添加星号”,“删除星号”等自定义状态,为表单条目提供了扩展选项。您可以通过添加用于过滤表单条目的更重要的操作来使插件具有唯一性。
This is one of the most vital features of a forms plugin. User should be allowed to export all forms with respective data and import it into another website or the same website. Gravity Forms provides the most organized import/export process compared to the other three plugins discussed in this article. The following screen previews the import/export screen of Gravity Forms.
这是表单插件最重要的功能之一。 应该允许用户导出所有带有相应数据的表格并将其导入另一个网站或同一网站。 与本文讨论的其他三个插件相比,Gravity Forms提供了最有条理的导入/导出过程。 以下屏幕预览了重力表格的导入/导出屏幕。
As you can see, you are allowed to select the forms, necessary fields and respective date range for exporting purposes. Exporting process will create a CSV file, which can be imported any time to restore the data. CSV is the simplest file format and hence should be used instead of relying on different file formats.
如您所见,您可以选择表格,必填字段和相应的日期范围以进行导出。 导出过程将创建一个CSV文件,可以随时导入以恢复数据。 CSV是最简单的文件格式,因此应使用CSV而不是依赖于不同的文件格式。
Most existing plugins provide their own import/export options. Here, we are trying to figure out the requirements to build the perfect forms plugin. So you can extend the import/export process by supporting exported files of other popular forms plugins and importing them into your plugin. This will make your plugin stand out from the rest.
大多数现有插件都提供了自己的导入/导出选项。 在这里,我们试图找出构建完美表单插件的要求。 因此,您可以通过支持其他流行形式的插件的导出文件并将其导入到您的插件中来扩展导入/导出过程。 这将使您的插件与众不同。
Generally, users don’t like long forms with a large number of fields. As a solution, we are using step by step forms to simplify the form filling process. We can apply the same technique for forms generated by these plugins. Basically, users can break the form into multiple sections in the form creation process. Once the form is displayed, we need to provide one section at a time until all sections are filled by the user. Only a few plugins support this feature, hence it can be useful to improve your plugin among the rest.
通常,用户不喜欢带有大量字段的长格式。 作为解决方案,我们将逐步使用表单来简化表单填充过程。 我们可以对这些插件生成的表单应用相同的技术。 基本上,用户可以在表单创建过程中将表单分为多个部分。 表单显示后,我们需要一次提供一个部分,直到用户填写了所有部分。 只有少数插件支持此功能,因此在其余插件中改进插件很有用。
So far, we’ve looked at the basic usages of forms plugins and the mandatory features to be competitive with popular plugins. Now it’s time to make our plugin unique from the rest. In the next section, we are going to look at the special features for making our forms plugin competitive with other plugins.
到目前为止,我们已经研究了表单插件的基本用法以及与流行插件竞争的强制性功能。 现在该让我们的插件与众不同了。 在下一节中,我们将研究使表单插件与其他插件竞争的特殊功能。
Forms plugins can be used for various tasks within WordPress websites and hence there are unlimited possibilities for creating new features. So let’s discuss some useful features that add value to your plugin and make it “more perfect” than the rest.
表单插件可用于WordPress网站中的各种任务,因此创建新功能的可能性无限。 因此,让我们讨论一些有用的功能,这些功能可为您的插件增加价值,并使它“比其他插件更完美”。
Basically, these forms plugins let us create forms from scratch using dynamic drag and drop fields. But there can be many occasions for the need of pre-built forms. In such cases we can allow the users to create form templates and reuse them for multiple forms. So users can just select a template, change the necessary fields and make it work without making large forms from scratch.
基本上,这些表单插件使我们可以使用动态拖放字段从头开始创建表单。 但是在很多情况下需要预先构建的表格。 在这种情况下,我们可以允许用户创建表单模板并将其重新用于多个表单。 因此,用户只需选择一个模板,更改必要的字段即可使其工作,而无需从头开始制作大型表格。
This feature is not supported by many plugins and hence can be used to add value to your plugin.
许多插件不支持此功能,因此可用于为插件增加价值。
This is one of the most promising features of forms plugins where users are allowed to change the form field content or form fields dynamically based on predefined conditions. A perfect solution for conditional logic is available in Gravity Forms.
这是表单插件最有前途的功能之一,允许用户根据预定义条件动态更改表单字段内容或表单字段。 重力形式可提供条件逻辑的理想解决方案。
Earlier, we discussed the need for form entries and filtering them by executing custom actions from the bulk action list. These plugins are mostly used for contact forms and hence the list of entries is good enough for most occasions. But we can make these plugins powerful by adding custom hooks and enable developers to implement their own features on form entries.
之前,我们讨论了对表单条目的需求,并通过执行批量操作列表中的自定义操作来过滤表单。 这些插件主要用于联系表单,因此条目列表足以应付大多数情况。 但是我们可以通过添加自定义钩子使这些插件变得强大,并使开发人员能够在表单条目上实现自己的功能。
You can create custom hooks to add more statuses to the form entries action list and another set of action hooks to execute tasks on the form entry. For example, assume that we are building a forms plugin for use with a contest. You can define a custom action called Select Winner and specify an action hook. Then developers can implement the action hook to execute necessary tasks when the winner is selected.
您可以创建自定义钩子,以将更多状态添加到表单条目操作列表中,并创建另一组操作钩子以执行表单条目上的任务。 例如,假设我们正在构建一个用于比赛的表单插件。 您可以定义一个名为“选择获胜者”的自定义动作,并指定一个动作挂钩。 然后,开发人员可以实施动作挂钩,以在选择获胜者时执行必要的任务。
Most people will use WordPress with its default functionality, instead of building custom application using plugins. Therefore, it’s essential to support existing WordPress features as much as possible with the forms plugin. Gravity Forms does this quite effectively by allowing admins to create forms, where users can submit posts from the front end.
大多数人会使用WordPress及其默认功能,而不是使用插件来构建自定义应用程序。 因此,使用表格插件尽可能多地支持现有的WordPress功能至关重要。 Gravity Forms通过允许管理员创建表单(用户可以在其中从前端提交帖子)来非常有效地做到这一点。
Similarly we can add more WordPress specific features into our plugins. For example we can add an upload button to load WordPress media uploader, allow creation of users from front end and so on. As long as we can extend our plugin with WordPress-specific features, we can make it stand out among other plugins.
同样,我们可以在插件中添加更多WordPress特定功能。 例如,我们可以添加一个上传按钮来加载WordPress媒体上传器,允许从前端创建用户等等。 只要我们可以使用WordPress特定功能扩展插件,就可以使其在其他插件中脱颖而出。
Throughout this article, we have discussed the basics of forms plugins and how we can plan our plugin to be competitive with existing WordPress forms plugins. There are mainly two ways of making your plugin unique from the rest.
在本文中,我们讨论了表单插件的基础知识以及如何计划我们的插件与现有WordPress表单插件竞争。 使插件与众不同的主要方法有两种。
Add as many WordPress specific features as possible into the forms creation and managing process 在表单创建和管理过程中添加尽可能多的WordPress特定功能 Support uncommon use cases for the need of forms plugins, instead of purely depending on contact forms 支持不常见的用例来满足表单插件的需求,而不仅仅是依赖于联系表单These days, forms plugins are used widely for quizzes, polls, order submissions, payment integration and many more purposes. So making a unique premium forms plugin can be a highly profitable business.
如今,表单插件已广泛用于测验,民意调查,订单提交,付款集成以及更多其他目的。 因此,制作独特的高级表单插件可以是一项高利润的业务。
Our four existing forms plugin providers give us some pretty useful functionalities and some clever implementations. Of these, Gravity Forms seems to be currently the most advanced. But we are developers, right? It’s our business to make the web more perfect than it is. That’s what our clients want. So, there’s no reason we can’t build our own forms plugins. Perhaps we can’t ever make the “perfect” forms plugin, but it’s the striving for perfection that keeps us moving forward.
我们现有的四个表单插件提供程序为我们提供了一些非常有用的功能和一些聪明的实现。 其中,重力形式似乎是目前最先进的形式。 但是我们是开发人员,对吗? 使网络变得更加完美是我们的业务。 那就是我们客户想要的。 因此,没有理由我们不能构建自己的表单插件。 也许我们永远无法制作“完美”的表单插件,但这是我们不断追求完美的追求。
Let us know what you think about WordPress forms plugins and how you want them to work in different scenarios.
让我们知道您对WordPress表单插件的看法,以及您希望它们在不同情况下如何工作。
Also feel free to share features in your mind so that developers here who are willing to make forms plugins can develop them for you. Or would you rather build them yourself?
也可以随意共享功能,以便愿意制作表单插件的开发人员可以为您开发这些功能。 还是您宁愿自己建造它们?
翻译自: https://www.sitepoint.com/planning-perfect-wordpress-forms-plugin/
相关资源:WordPress自定义表单插件cformsII