Teja Amilineni
2014-02-24 17:46:41 UTC
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 - Loading Image...
@Nick - Your feedback on this will definitely help!
Teja
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 - Loading Image...
@Nick - Your feedback on this will definitely help!
Teja
Send wp-hackers mailing list submissions to
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
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of wp-hackers digest..."
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
Subject: [wp-hackers] Getting patches reviewed?
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).
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
Subject: [wp-hackers] Introducing myself
<CACF6iDTUVp6peqWM+1CM3=
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
Subject: Re: [wp-hackers] MySQL: Union vs global table
Content-Type: text/plain; charset="windows-1252"
Hi wp-hackers,
With Dino?s permission I?m sharing the email he sent me and my reply -
???
Hi Dino,
their own blogs.
(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).
I think you need an index on wp_slim_stats.dt to avoid the sort - but
otherwise it?s an efficient query.
popular network-wide, etc.
global wp_slim_stats that includes a new column blog_id.
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
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
Subject: Re: [wp-hackers] ISP hacking web pages
Content-Type: text/plain; charset=windows-1252
FYI- this list is WordPress specific -- your message really doesn't fit
"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
through their network to your home/office connection?
outgoing e-mails?
------------------------------
Message: 5
Date: Mon, 24 Feb 2014 09:27:01 -0600
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
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
Message: 6
Date: Mon, 24 Feb 2014 11:06:38 -0500
Subject: Re: [wp-hackers] Introducing myself
Content-Type: text/plain; charset=windows-1252
Hi Vikas,
https://codex.wordpress.org/GSoC2014
-J.D.
Message: 7
Date: Mon, 24 Feb 2014 22:03:39 +0530
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
<CALwcwQrgqEfPhG1EEN3_NUdrj2kJp4EGdmtAyZi=
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
ever
wp-hackers mailing list
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)
Mail
*Birla Institute of Technology & Science,* Pilani
Pilani Campus, Rajasthan 333 031, INDIA
------------------------------
Message: 8
Date: Mon, 24 Feb 2014 10:51:00 -0600
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
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
Subject: Digest Footer
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
------------------------------
End of wp-hackers Digest, Vol 109, Issue 35
*******************************************
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
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of wp-hackers digest..."
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
Subject: [wp-hackers] Getting patches reviewed?
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).
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
Subject: [wp-hackers] Introducing myself
<CACF6iDTUVp6peqWM+1CM3=
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
Subject: Re: [wp-hackers] MySQL: Union vs global table
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 fortheir own blogs.
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_idFROM 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 =
ORDER BY t1.dt desc
LIMIT 0, 50
The corresponding explain is attached as explain-select-1.png.
MySQL examines table t1 (wp_slim_stats) first and applies a sort on dtLIMIT 0, 50
The corresponding explain is attached as explain-select-1.png.
(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).
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 mostpopular 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 aglobal 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. Thenew 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
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
Subject: Re: [wp-hackers] ISP hacking web pages
Content-Type: text/plain; charset=windows-1252
FYI- this list is WordPress specific -- your message really doesn't fit
"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
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 passesthrough 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/oroutgoing e-mails?
------------------------------
Message: 5
Date: Mon, 24 Feb 2014 09:27:01 -0600
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
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
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]
"
------------------------------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
Subject: Re: [wp-hackers] Introducing myself
Content-Type: text/plain; charset=windows-1252
Hi Vikas,
https://codex.wordpress.org/GSoC2014
-J.D.
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
http://lists.automattic.com/mailman/listinfo/wp-hackers
------------------------------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
http://lists.automattic.com/mailman/listinfo/wp-hackers
Message: 7
Date: Mon, 24 Feb 2014 22:03:39 +0530
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
<CALwcwQrgqEfPhG1EEN3_NUdrj2kJp4EGdmtAyZi=
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
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
whatA 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
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,other shortcodes within a form? What if those also output a <form>
breaking your form?
PS- Always prefix your shortcodes to avoid collisions with other plugins
&PS- Always prefix your shortcodes to avoid collisions with other plugins
themes.
_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske
Short_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske
For Example : The UI for the Form Making will generate this sort of
Code which will be displayed as a Proper Form in the Form Page where
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]
"
_______________________________________________"
[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
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)
*Birla Institute of Technology & Science,* Pilani
Pilani Campus, Rajasthan 333 031, INDIA
------------------------------
Message: 8
Date: Mon, 24 Feb 2014 10:51:00 -0600
Subject: Re: [wp-hackers] Fwd: [GSoC - 2014] Introducing Myself
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
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
toI had not realized that. ! Thanks for pointing it out. ! :)
I will now take it into account and start thinking of an alternative way
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
andshort 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
Advices are always welcome. !
Thanks.
Regards,
Deven
------------------------------Thanks.
Regards,
Deven
Subject: Digest Footer
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
------------------------------
End of wp-hackers Digest, Vol 109, Issue 35
*******************************************