[wp-hackers] [GSoC 14] WordCamp Forms Plugin ideas

Teja Amilineni teja.amil at gmail.com
Mon Feb 24 17:46:41 UTC 2014


Hi Nick & Deven

Adding to the dialogue, @Deven - Nick has some valid points.  You can zero
in on a lot of best practices by looking at other forms plugins. I have
been working on this too.

One plausible way I could come up with was using custom-post-type and its
custom-fields. I quickly hooked these and came up with a basic workflow
like this - http://i.imgur.com/VzO3UV6.png

@Nick - Your feedback on this will definitely help!

Teja



On Monday, February 24, 2014, <wp-hackers-request at lists.automattic.com>
wrote:

> Send wp-hackers mailing list submissions to
>         wp-hackers at lists.automattic.com <javascript:;>
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
>         wp-hackers-request at lists.automattic.com <javascript:;>
>
> You can reach the person managing the list at
>         wp-hackers-owner at lists.automattic.com <javascript:;>
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
>
>
> Today's Topics:
>
>    1. Getting patches reviewed? (David Anderson)
>    2. Introducing myself (Vikas Yadav)
>    3. Re: MySQL:  Union vs global table (Morgan Tocker)
>    4. Re: ISP hacking web pages (Nicholas Ciske)
>    5. Re: Fwd: [GSoC - 2014] Introducing Myself (Nicholas Ciske)
>    6. Re: Introducing myself (J.D. Grimes)
>    7. Re: Fwd: [GSoC - 2014] Introducing Myself (Deven Bansod)
>    8. Re: Fwd: [GSoC - 2014] Introducing Myself (Nicholas Ciske)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 24 Feb 2014 12:57:58 +0000
> From: David Anderson <david at wordshell.net <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: [wp-hackers] Getting patches reviewed?
> Message-ID: <530B41D6.10504 at wordshell.net <javascript:;>>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> I've contributed a few bug reports and patches to WP core trac, but so
> far, they've all attracted no attention.
>
> Since I'm new to contributing to core, I'm ignorant as to how to get
> some eyeballs on them. In keeping with them being first efforts, I went
> for items that were easily reproducible bugs, and easily fixed with
> simple patches. (They are all also issues that have caused me multiple
> support requests, and time spent debugging the causes, in the real-world).
>
> Can anyone here give me a clue as to whether there's something I should
> do, or do I just lack patience? (A couple of them are 2 months old).
>
> Tickets:
> https://core.trac.wordpress.org/ticket/26598 - broken methods in
> WP_Filesystem_Direct and WP_Filesystem_SSH2
> https://core.trac.wordpress.org/ticket/26626 - prevent avoidable unzip
> failure due to 256-character pathname limits on some platforms
> https://core.trac.wordpress.org/ticket/26887 - mark an implicitly public
> and important (to backup plugins) property as explicitly public (more of
> an enhancement than a bug)
> https://core.trac.wordpress.org/ticket/27196 - more informative message
> when plugin install fails (I confess, I filed this one only 5 minutes
> ago - but I'm reluctant to see it suffer the same trip into limbo as the
> previous three efforts, if mentioning it can help avoid that!)
>
> Best wishes,
> David
>
> --
> UpdraftPlus - best WordPress backups - http://updraftplus.com
> WordShell - WordPress fast from the CLI - http://wordshell.net
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 24 Feb 2014 20:33:55 +0530
> From: Vikas Yadav <wicked.yadav at gmail.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: [wp-hackers] Introducing myself
> Message-ID:
>         <CACF6iDTUVp6peqWM+1CM3=
> 2575nsJ8_e9kWj76k_PLTph7cbZg at mail.gmail.com <javascript:;>>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi, I am interested in participating in GSOC14 under WordPress. Can
> somebody guide me on what i should do and how do i proceed. I have
> intermediate knowledge of php, js and i have already gone through the
> codebase and installed it in my system. Please suggest me a basic project
> that i can work upon.
>
> Thanks,
> Vikas Yadav
> B.Tech 1st Year, Computer Science and Engineering
> IIT Roorkee, INDIA
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 24 Feb 2014 10:11:59 -0500
> From: Morgan Tocker <morgan.tocker at oracle.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] MySQL:  Union vs global table
> Message-ID: <BD297383-AF9D-4BDE-917C-A55E4CE2E606 at oracle.com<javascript:;>
> >
> Content-Type: text/plain; charset="windows-1252"
>
> Hi wp-hackers,
>
> > thank you so much for your availability. I will contact you in private
> shortly.
>
> With Dino?s permission I?m sharing the email he sent me and my reply -
>
> ???
>
> Hi Dino,
>
> > thank you again for your time. Attached you can find the definition for
> the tables used by my plugin, for your reference.
> > It's basically a real time analytics tool for WordPress. The main table
> is wp_slim_stats, which contains all the pageviews.
> >
> > In a MU environment, the plugin will create its tables for each new site
> (wp_1_slim_stats, wp_2_slim_stats, etc). Site admins can access reports for
> their own blogs.
> >
> > An activity log in reverse chronological order would be something like:
> >
> > SELECT t1.*, tb.*,tci.*
> > FROM wp_slim_stats t1
> >    INNER JOIN wp_slim_browsers tb ON t1.browser_id = tb.browser_id
> >    INNER JOIN wp_slim_content_info tci ON t1.content_info_id =
> tci.content_info_id
> > ORDER BY t1.dt desc
> > LIMIT 0, 50
> >
> > The corresponding explain is attached as explain-select-1.png.
>
> So here is how this is working:
>
> MySQL examines table t1 (wp_slim_stats) first and applies a sort on dt
> (will be expensive if there are a lot of rows).
> From the largest dt value until 50 is reached, it will very efficiently do
> a primary key lookup on tb (wp_slim_browsers) and then tci
> (wp_slim_content_info).  As long as there is full participation (INNER JOIN
> always finds rows in this table, the joining is efficient).
>
> Short story:
> I think you need an index on wp_slim_stats.dt to avoid the sort - but
> otherwise it?s an efficient query.
>
> > Now, some users have requested to get a Network View of their reports,
> which basically combines all the pageviews to see what post is the most
> popular network-wide, etc.
> >
> > In order to do that, I was thinking about two approaches: 1) do a UNION
> ALL of all those selects or 2) replace all the blog-specific tables with a
> global wp_slim_stats that includes a new column blog_id.
> >
> > The latter seems to be easier to implement, but what about performances?
> Think about a network with 100 blogs that make 100k pageviews/month. The
> new global table would have 100x100k = 10M records.
>
> You would not be UNION?ing ALL millions of rows though, you?d be UNIONing
> top 50 from all tables right?  As long as you can use the indexes (like the
> query you specified), then the number of rows in the table doesn?t matter.
>  I think as long as it is efficient enough, this is probably the more
> desired option?
>
> In MySQL until 5.7 (currently in developer preview) UNION ALL needs to
> creates a temporary table to buffer results before sending them to the
> client (so there is a small level of inefficiency), so make sure that each
> query being unioned doesn?t have too many rows.  More information on this
> optimization on my blog here:
>
>
> http://www.tocker.ca/2013/12/10/testing-the-union-all-optimization-in-mysql-5.7-dmr3.html
>
>
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: table-definitions.txt
> URL: <
> http://lists.automattic.com/pipermail/wp-hackers/attachments/20140224/e2e43515/attachment-0001.txt
> >
> -------------- next part --------------
>
> -------------- next part --------------
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 24 Feb 2014 09:16:24 -0600
> From: Nicholas Ciske <nl at thoughtrefinery.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] ISP hacking web pages
> Message-ID: <E1E084CF-56E7-4FAB-AC9B-5515131A3D7D at thoughtrefinery.com<javascript:;>
> >
> Content-Type: text/plain;       charset=windows-1252
>
> FYI- this list is WordPress specific -- your message really doesn't fit
> the purpose of the list:
>
> "The wp-hackers list is meant for people interested in extending WordPress
> either through plugins or improvements to the core code."
>
> _________________________
> Nick Ciske
> http://thoughtrefinery.com/
> @nciske
>
> On Feb 23, 2014, at 1:18 PM, Guus (IFS) <guus at inspiration-for-success.com<javascript:;>>
> wrote:
>
> > I know this does not belong here, but it?s unimaginable: an ISP hacking
> web pages by inserting a script in any non-secure web page that passes
> through their network to your home/office connection?
> >
> > What to do about something like that? I want this to stop as to me it?s
> criminal. Where does it stop? Do they also change my incoming and/or
> outgoing e-mails?
>
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 24 Feb 2014 09:27:01 -0600
> From: Nicholas Ciske <nl at thoughtrefinery.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
> Message-ID: <FE6D95F9-44ED-40B4-BE4B-8E2DB53AF702 at thoughtrefinery.com<javascript:;>
> >
> Content-Type: text/plain;       charset=us-ascii
>
> I'd not advise pursuing this approach to shortcodes...
>
> A single shortcode to output the form by id or name is the current (and
> best) practice.
>
> See: every other form plugin available for WordPress.
>
> Running dozens of short codes to output a form that's already been
> designed on the backend? That's going to use a lot of resources -- for what
> gain? Not to mention how brittle this approach is... e.g. can I intermix
> other shortcodes within a form? What if those also output a <form> element,
> breaking your form?
>
> PS- Always prefix your shortcodes to avoid collisions with other plugins &
> themes.
>
> _________________________
> Nick Ciske
> http://thoughtrefinery.com/
> @nciske
>
> On Feb 24, 2014, at 1:59 AM, Deven Bansod <devenbansod.bits at gmail.com<javascript:;>>
> wrote:
>
> > For Example : The UI for the Form Making will generate this sort of Short
> > Code which will be displayed as a Proper Form in the Form Page where ever
> > the Form is Placed.
> >
> > "
> > [form_start]
> >
> > [element type='text' label='Name'/]
> > [element type='text' label='Gender' option='M,F'/]  // Will produce two
> > Radio Buttons with M and F as Labels and Original Label as Gender
> >
> > [/form_start]
> >
> > "
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 24 Feb 2014 11:06:38 -0500
> From: "J.D. Grimes" <jdg at codesymphony.co <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] Introducing myself
> Message-ID: <D614BCF5-D378-4AC9-9DB1-57F3B961AD73 at codesymphony.co<javascript:;>
> >
> Content-Type: text/plain; charset=windows-1252
>
> Hi Vikas,
>
> If you haven?t already read this, it is a good place to start:
>
> https://codex.wordpress.org/GSoC2014
>
> -J.D.
>
> On Feb 24, 2014, at 10:03 AM, Vikas Yadav <wicked.yadav at gmail.com<javascript:;>>
> wrote:
>
> > Hi, I am interested in participating in GSOC14 under WordPress. Can
> > somebody guide me on what i should do and how do i proceed. I have
> > intermediate knowledge of php, js and i have already gone through the
> > codebase and installed it in my system. Please suggest me a basic project
> > that i can work upon.
> >
> > Thanks,
> > Vikas Yadav
> > B.Tech 1st Year, Computer Science and Engineering
> > IIT Roorkee, INDIA
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com <javascript:;>
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 24 Feb 2014 22:03:39 +0530
> From: Deven Bansod <devenbansod.bits at gmail.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
> Message-ID:
>         <CALwcwQrgqEfPhG1EEN3_NUdrj2kJp4EGdmtAyZi=
> HKmy-ounew at mail.gmail.com <javascript:;>>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Thanks Nick !
>
> I had not realized that. ! Thanks for pointing it out. ! :)
>
> I will now take it into account and start thinking of an alternative way to
> do it where I just have to take in the Form ID/Name as arguments for the
> short code.
>
> I have an idea that User would make the form with the UI(opening in a new
> iframe I guess from a Button in post.php?post_type=form)
> and then save it. The Plugin will save the final HTML of the Form in the
> "post_content" in "wp_posts" as "Draft" with CPT of "form".
>
> User can use the Shortcode in any post/page with the Form ID if they want
> or can just publish this 'form' as it is.
>
> Will keep the mailing list posted on any new development ! Suggestions and
> Advices are always welcome. !
>
> Thanks.
>
> Regards,
> Deven
>
>
> On Mon, Feb 24, 2014 at 8:57 PM, Nicholas Ciske <nl at thoughtrefinery.com<javascript:;>
> >wrote:
>
> > I'd not advise pursuing this approach to shortcodes...
> >
> > A single shortcode to output the form by id or name is the current (and
> > best) practice.
> >
> > See: every other form plugin available for WordPress.
> >
> > Running dozens of short codes to output a form that's already been
> > designed on the backend? That's going to use a lot of resources -- for
> what
> > gain? Not to mention how brittle this approach is... e.g. can I intermix
> > other shortcodes within a form? What if those also output a <form>
> element,
> > breaking your form?
> >
> > PS- Always prefix your shortcodes to avoid collisions with other plugins
> &
> > themes.
> >
> > _________________________
> > Nick Ciske
> > http://thoughtrefinery.com/
> > @nciske
> >
> > On Feb 24, 2014, at 1:59 AM, Deven Bansod <devenbansod.bits at gmail.com<javascript:;>
> >
> > wrote:
> >
> > > For Example : The UI for the Form Making will generate this sort of
> Short
> > > Code which will be displayed as a Proper Form in the Form Page where
> ever
> > > the Form is Placed.
> > >
> > > "
> > > [form_start]
> > >
> > > [element type='text' label='Name'/]
> > > [element type='text' label='Gender' option='M,F'/]  // Will produce two
> > > Radio Buttons with M and F as Labels and Original Label as Gender
> > >
> > > [/form_start]
> > >
> > > "
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com <javascript:;>
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
>
> --
>
>
> *Regards,Deven G. Bansod;*
> IInd Year Student
> B.E.(Hons.) Computer Science + M.Sc.(Hons.)Economics(Dual Degree)
> *Contact : * *Gmail* <devenbansod.bits at gmail.com <javascript:;>>*  BITS
> Mail
> <f2012316 at pilani.bits-pilani.ac.in <javascript:;>>* *Alternate Email
> <bansod_deven at yahoo.co.in <javascript:;>>*
>
> *Birla Institute of Technology & Science,* Pilani
> Pilani Campus, Rajasthan 333 031, INDIA
> * <f2012316 at pilani.bits-pilani.ac.in <javascript:;>>*
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 24 Feb 2014 10:51:00 -0600
> From: Nicholas Ciske <nl at thoughtrefinery.com <javascript:;>>
> To: wp-hackers at lists.automattic.com <javascript:;>
> Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
> Message-ID: <4C82D5C5-E1B3-4CB8-9979-07C69345A90C at thoughtrefinery.com<javascript:;>
> >
> Content-Type: text/plain; charset=us-ascii
>
> Deven,
>
> Please download a few popular form plugins and see how they handle things
> -- they've already solved the problems you're facing -- the beauty of open
> source is that you can learn from other's code.
>
> http://formidablepro.com
> http://wordpress.org/plugins/ninja-forms/
>
> Making a new form in an iframe popup is a interesting idea -- would be
> good for quick forms. However, is that the workflow users will use? Or will
> they author the the form and them want to insert it into (possibly
> multiple) posts/pages/widgets? I'm not saying either way is correct, I'm
> asking you to evaluate the best workflow for your users before making
> architectural decisions.
>
> Saving the HTML is probably not what you want to do -- forms are dynamic
> things -- so the are generally best generated each time, so they can take
> into account the current state (required fields, errors, etc). i.e. Save
> the meta data about the form in custom fields on the custom post type
> instead, then generate the form when it's viewed.
>
> _________________________
> Nick Ciske
> http://thoughtrefinery.com/
> @nciske
>
> On Feb 24, 2014, at 10:33 AM, Deven Bansod <devenbansod.bits at gmail.com<javascript:;>>
> wrote:
>
> > Thanks Nick !
> >
> > I had not realized that. ! Thanks for pointing it out. ! :)
> >
> > I will now take it into account and start thinking of an alternative way
> to
> > do it where I just have to take in the Form ID/Name as arguments for the
> > short code.
> >
> > I have an idea that User would make the form with the UI(opening in a new
> > iframe I guess from a Button in post.php?post_type=form)
> > and then save it. The Plugin will save the final HTML of the Form in the
> > "post_content" in "wp_posts" as "Draft" with CPT of "form".
> >
> > User can use the Shortcode in any post/page with the Form ID if they want
> > or can just publish this 'form' as it is.
> >
> > Will keep the mailing list posted on any new development ! Suggestions
> and
> > Advices are always welcome. !
> >
> > Thanks.
> >
> > Regards,
> > Deven
> >
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com <javascript:;>
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
> ------------------------------
>
> End of wp-hackers Digest, Vol 109, Issue 35
> *******************************************
>


More information about the wp-hackers mailing list