Skip to content

Commit 59a3007

Browse files
committed
Update README.md
1 parent 837dd35 commit 59a3007

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ easily and silently. A WooCommerce product with 40 variations can have over 1300
1414
form items, and when saving the product you have no idea that much of that data is being
1515
discarded.
1616

17-
Luckily the maximum number of accepted parameters can be changed in php.ini The problem is,
17+
Luckily [the maximum number of accepted parameters can be changed in php.ini](http://docs.woothemes.com/document/problems-with-large-amounts-of-data-not-saving-variations-rates-etc/)
18+
The problem is,
1819
many site owners have no idea this needs to be done until it is too late and their
1920
WooCommerce store has lost half its product variations.
2021

@@ -31,7 +32,7 @@ items the server will accept when the page is generated, so it has a number to c
3132

3233
### Client-side JavaScript
3334

34-
The simplest way to implement the check is to use this JavaScript in the jQuery ready()
35+
The simplest way to implement the check is to use this JavaScript in your jQuery ready()
3536
function:
3637

3738
$('form').maxSubmit({max_count: 1000});
@@ -43,8 +44,8 @@ dialog. You can target specific forms with different settings if you wish.
4344

4445
### Server-side Code
4546

46-
The server limit (1000 in this case) needs to be passed into the script above. This can
47-
be found with a simple PHP function like this:
47+
The server limit (1000 in the above example) needs to be calculated dynamically on the
48+
server. It can be found with a simple PHP function like this:
4849

4950
/**
5051
* Get the submission limit.
@@ -55,7 +56,7 @@ be found with a simple PHP function like this:
5556
* apply to POST forms, so POST is important. The REQUEST max vars is
5657
* another thing to consider, as it will be the sum of GET and POST parameters.
5758
*/
58-
function getFormSubmissionLimit($default = false)
59+
/* public */ function getFormSubmissionLimit($default = false)
5960
{
6061
// All these ini settings will affect the number of parameters that can be
6162
// processed. Check them all to find the lowest.
@@ -65,8 +66,10 @@ be found with a simple PHP function like this:
6566
$ini[] = ini_get('suhosin.post.max_vars');
6667
$ini[] = ini_get('suhosin.request.max_vars');
6768

69+
// Strip out the blanks - ini options not set.
6870
$ini = array_filter($ini, 'is_numeric');
6971

72+
// Find the smallest of them all.
7073
$lowest_limit = min($ini);
7174

7275
return ($lowest_limit === false ? $default : $lowest_limit);

0 commit comments

Comments
 (0)