Upfront theme doesn't works with upload quotats and other limitations in pro sites

hi , in upfront when i upload some files i can continue to upload files when i reach upload limitations, Is it possible to limit upload in upfront with "Upload Quota" module in pro sites ?

  • Kasia Swiderska
    • Support nomad

    Hello Arthur,

    Are you sure images are uploaded in Upfront theme despite the quota limit? I'm testing this on my site and yes, Upfront shows that images are uploading but it doesn't finish job and there are no new images on the server.
    This doesn't look good and there should some information about quota limit, but still images should not be uploaded.

    Would you mind allowing support access so we can have a closer look at this?
    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    kind regards,
    Kasia

  • Arthur
    • Flash Drive

    Hi, Kasia.
    Yes , i put a limitation in Pro sites at 10MB For the first level.
    I'm now testing with this level on a new website.
    The user can upload files after the quota limit is reach with Upfront, also in the media library i uploaded 15MB of files with upfront and it appears "0,24 MB (2%) of 10,00 MB used." ,
    The only files that are taken into quotat by the system are those that have been uploaded to the site creation.
    Also i can upload files from the backend and they're taken in the upload quotat.

    I ENABLE SUPPORT ACCESS .

  • Arthur
    • Flash Drive

    when i upload with the wordpress back end uploader the system include the file in the quotas but with upfront it doesn't works ... i created a new website in a multisite installation and i have the same bug ... help me please :slight_smile:

  • Kasia Swiderska
    • Support nomad

    Hello Arthur,

    Thank you for this detailed description and screens - with it I was able to replicate this issue on my site also. I'm marking this as bug and letting developers of Pro Sites and Upfront know that Upfront allows to bypass quota limits.

    As soon as I will get feedback on this issue I will update this thread.

    kind regards,
    Kasia

  • Arthur
    • Flash Drive

    Hello, do you think it's possible to replace the upfront uploader by the 'classic wordpress uploader' like in visual composer or themify builder ?
    also i tested, and upfront bypasses wordpress multisite limitations, not only pro sites limitations
    Tell me if you heard something about a fix ...
    Have a nice day :slight_smile:

  • Arthur
    • Flash Drive

    wordpress uses a function in wp-includes/ms-functions.php called get_space_used()
    first This function gets a value which is then cached in the wp_options table with the option name of _transient_dirsize_cache if i delete this value the size of the files is uploaded but i can continue to upload files with upfront only.
    do you think we can make a function who call get_space_used() in the upfront media server and another who upload the term _transient_dirsize_cache ? if it's possible it's perfect !

    Can we do something like that

    <?php
    $allowed = get_space_allowed();
    $used = get_space_used();
    if ($used > $allowed)
    {
      //shout an error and break the upload
    }
    
    ?>

    and at the end of the program we must upload the mysql database with something like that
    $sql = "UPDATE wp_options ". "SET _transient_dirsize_cache = null ".

    can we put this in class_upfront_media_server.php ?
    Help me to create a little code for that
    Thank's :slight_smile:

    i also see a filter pre_get_space_used which can be usable for this little function.

  • Kasia Swiderska
    • Support nomad

    Hello Arthur,

    I'm not developer but you are right with _transient_dirsize_cache - I just saw notes from developers. This has to be resolved on Upfront side - cache has to be deleted after upload. I'm still waiting for patch - developer will probably use _wp_handle_upload() https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/file.php#L397

    I will update you when I will have feedback in bug report.

    kind regards,
    Kasia

  • Arthur
    • Flash Drive

    Thank you Kasia, yes i resolved it by uploading the database (dirsize cache) with an sql query every time someone upload a file also i changed a little bit of the upload handler program to check if the file isn't too big,

    397	        if ( is_multisite() ) {
    398	                delete_transient( 'dirsize_cache' );

    Can be helpful.
    My solution isn't performance perfect but ... it seems to work :p
    i wait devellopers update :smiley:

    have a nice day :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.