-
Hi
I am using the Codestar Framework in a plugin.
I created a repeating group field but there is an issue, I can't add more than 20 items in one post. Actually my repeater group contains large number of items.
If I add more items then after updating post only first 20 items save and rest items delete automatically.
And getting php warning:-
PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
CopyCopied!Posted 1 year ago # -
Hi,
Yes, actually you found the issue. the max_input_vars 1000 is very little. You have to raise it. There are some ways:
php.ini method.
max_input_vars = 10000
CopyCopied!.htaccess method.
php_value max_input_vars 10000
CopyCopied!wp-config.php file method.
@ini_set( 'max_input_vars' , 10000 );
CopyCopied!Regards, Codestar
Posted 1 year ago # -
Actually 90% hosting providers have 1000 as php input variable - I'm using a vps server with good speed.
Also product will be used by multiple clients so everyone can not can change it inside server / hosting php ini.
There must be optimization inside the code.
What if i add 100+ repeaters with large data, then 10000+ input variables will also become small for that.
Can we send data in parts?
Posted 1 year ago # -
Hi,
Yes right, but this case is same for all frameworks. For eg. If you try same thing in Redux or AFC you will get same issue. There is no option send data in parts. But I can try to improve it in next update.
Actually the correct way is that repeater must be Story CPT ( custom post type ) in this case.
Title: Post Title
Description: Post Content
Other option should be metabox option of that CPT.Regards, Codestar
Posted 1 year ago # -
Yes, custom post type is best option for that.
But we already have another plugin - Cool Timeline Pro - It uses custom post type.
Currently many users are asking to create a quick timeline at one place with drag-drop story order functionality so we created that.
It's oky let us know if you find any solution or we will add some other flow....
Thanks for your time.
Posted 1 year ago # -
Hi,
I noted this issue for next updates, I'll try. By the way, there is an action after save like this csf_{PUT-YOUR-METABOX-UNIQ-ID}_saved
if ( ! function_exists( 'satinder_save_in_parts' ) ) { function satinder_save_in_parts( $data, $post_id ) { var_dump( $data ); var_dump( $post_id ); // code here for save in parts. // code here for save in parts. // code here for save in parts. } add_action( 'csf_{PUT-YOUR-METABOX-UNIQ-ID}_saved', 'satinder_save_in_parts', 10, 2 ); }
CopyCopied!Maybe you can try something in this action and share me if it works, thats can inspire me.
Regards, Codestar
Posted 1 year ago # -
I've been thinking about this as well...
The problem is the $_POST object. If it contains more items than the server allows for it will always be an issue, and the server will receive that long before any code is processed for it.
""Actually 90% hosting providers have 1000 as php input variable""
While, 1000 is the default configuration, 3000 is more common, and most hosting companies will not have an issue increasing it to that.
I would push back on the host to have it increased. It's not an uncommon request, and even up to 5000 is reasonable. (I host websites for a living, having 2000+ websites spread over 45 WPEngine servers, 20 AWS linux servers, and a dozen or so Windows servers)
Posted 1 year ago # -
Hi,
Yes, I agree @kpirnie,
1000 "max_input_vars" is so low really. You must talk with your hosting provider. Standard should be between 3000-5000. It will be issue for admin-options as well.
Regards, Codestar
Posted 1 year ago # -
Hi there,
I am facing the same issue. Suppose, I created 50 items with the group repeater. It saves limited items and rests get deleted automatically.
It doesn't show any error on my local server though.
The group repeater is a very important feature of the plugin.
A solution would be highly appreciated.
Regards,
ShamimPosted 10 months ago # -
Shamim
Your only resolution to this issue is to follow the discussion above how we told you you need to contact your hosting company and have the max_input_vars changed.There is NO getting around this... period.
Posted 10 months ago # -
Yes, said as @kpirnie.
Posted 9 months ago # -
Thanks for the reply.
Actually, I have more than 100k users (of some of my plugins).
Telling them to contact their hosting providers is not a good option.
I was looking for any technical improvement I can make to the plugin(framework).
Regards
Posted 9 months ago # -
@ShapedTheme
I'm not really sure where the disconnect is here, but let's see if I can put this as plain and as dumbed down as possible for you.You have no choice. You must contact the hosting company.
Simply put, this is NOT a limitation, bug, or otherwise of this framework.
It IS, however, a limitation of web hosting companies... and it IS in place as a security precaution against hackers who would otherwise attempt to overload a server with monstrous form posts.
AGAIN:
YOU HAVE NO CHOICE IN THIS MATTER, AND NEITHER DOES ANYONE ELSE IN THIS CIRCUMSTANCE. THE ONLY ONES THAT CAN FIX THIS FOR YOU IS YOUR HOSTING SERVICE PROVIDERS.Posted 9 months ago # -
Hi @ShapedTheme,
Please do not misunderstand. But it's true.
You know Avada theme has 800k sales. See the MaxInputVars documentation. Telling same things with us.
https://theme-fusion.com/documentation/avada/installation-maintenance/how-to-adjust-system-status-limits/#PHPMaxInputVarsAlso Udesign:
https://support.undsgn.com/hc/en-us/articles/213459869Also JupiterX (artbees)
https://themes.artbees.net/docs/increase-max-input-vars/I can give more example. I am really ready for help, but this is not in my control. Also that max_input_vars affect the Appearance -> Menus. for eg. when you try to add 50+ menu items it will not save if you have not enough max_input_vars value.
I think it's clear now.
Regards, Codestar
Posted 9 months ago # -
Hi @Codestar,
It's absolutely clear now and I understood.
Thank you so much for the detailed answer. You are a good man.
Regards,
ShapedThemePosted 9 months ago # -
Hi @ShapedTheme,
You're welcome and thanks for understanding bro. Also I'll be ready for helps always.
Have a nice day.
Regards, CodestarPosted 9 months ago #