WordPress.org

Ready to get started?Download WordPress

Forums

Simple 301 Redirects
Cannot enter more then 499 entries (9 posts)

  1. ben.at
    Member
    Posted 4 months ago #

    When using Simple 301 Redirects V1.06 I was unable to enter new entries beyond entry number 499.
    It said settings saved but the new entry never showed.

    I found this to be because of the php setting max_input_vars, default: 1000, because the input form will need 2 fields per entry.

    So I had to increase this setting, ini_set was not working due to security restrictions but placing the following .htaccess file in the /wp-admin folder solved the issue:

    # Setting by Ben for simple 301 redirects
    php_value max_input_vars 2000

    https://wordpress.org/plugins/simple-301-redirects/

  2. scottnelle
    Member
    Plugin Author

    Posted 3 months ago #

    Wow, thanks Ben! The data is stored in a serialized string and until now I haven't been able to figure out what the limiting factor for string size is. This is the first time someone's been able to track down the source of this problem.

    I'll see if there's something I can do to fix this directly in the plugin. Barring that, I'll point people to your solution until I can implement a different storage mechanism for the data.

    Thanks again!

  3. mayrrecordscan
    Member
    Posted 2 months ago #

    Hey scottnelle. i guess it's not the perfect solution to store maybe up to thousands of links in a serialized array. i had a similar difficulty, so i decided to load the data direct from a csv file. you can get line by line while you check against the incoming link.

    http://www.php.net/manual/en/function.fgetcsv.php

  4. Ash Durham
    Member
    Posted 2 months ago #

    This issue doesn't have anything to do with "how" you store the data, its the form itself. Generally speaking, as soon as a user gets to 250 redirects (2 input fields per redirect = 500 input fields), most are hitting the problem.

    Scott, the quickest way to get around this is to not have all the redirects in input fields, just print them to page. This way you'll never hit the limit. Create an edit button on the right with the remove button, load the values into input fields via javascript at that point.

    This will obviously affect the way your saving the values. When you split out the serialised value to display to the page, you could json the group (old redirect/new redirect) and have it in a data attribute - that will allow you to pass the values to the dynamic inputs on edit - then submit the form via an ajax call, compiling the changed and unchanged values in javascript, and passing back to the server as 1 json value, decode, serialise, save.

    Save that to the database, or take mayrrecordscan's idea of storing in a CSV. Either way, the general process above will fix the issue at hand.

  5. scottnelle
    Member
    Plugin Author

    Posted 1 month ago #

    You're absolutely right, Ash. After taking a second look at what Ben did to resolve the issue, I arrived at the same conclusion. It's the way that the plugin was entering the data that was causing problems.

    I've got an update that's more-or-less along the same lines as your suggestion just about ready to go. I'm doing some final testing and interface enhancements now. Thanks for your feedback!

  6. Ash Durham
    Member
    Posted 1 month ago #

    No worries, anything I can do to help ;)

  7. leo4all
    Member
    Posted 4 weeks ago #

    @scottnelle when are you going to release this new update I having issue with more entries.

    regards.

  8. BDDierks
    Member
    Posted 2 weeks ago #

    Any status on this?

  9. jsgd
    Member
    Posted 4 days ago #

    Any update on this, running into the same issue. Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.