• Resolved futureyoon

    (@futureyoon)


    Hi

    I noticed that there is a job running periodically on the webiste when I enabled uncanny automator.

    uoa_redirect/

    may I know what this is and is it possible to turn this off?

    Thank you

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Thanks for the note!

    uoa_redirect is related to “closures” in recipes, and will load when you have recipes that do things like redirect on completion. If you don’t want it to run, you can remove any redirects from recipes and it should stop for you.

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon , we hope the last update resolved things for you. We’ll close this ticket since it has been over 2 weeks since the last update, but let us know if you still need any assistance.

    Thread Starter futureyoon

    (@futureyoon)

    Hi there

    Thank you for the follow up.
    I still see uoa_redirect is happening on certain pages.
    is there a way to see which recipes have ‘redirect’ feature enabled? (backend filter or even from database table..)

    I have bunch of recipes to check 1 by 1 which is bit inconvenient and i still couldnt find one.

    Thank you

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    That’s a good point.

    Our dev team came up with some code you could use to add a “Closure” column in the recipe list and it will show “Yes” if there’s a closure live for that recipe.

    Here’s the code sample you could use for this:

    https://gist.github.com/saad-siddique/b9a4e49dc866e4945339eed2dc2deb1c

    Thread Starter futureyoon

    (@futureyoon)

    I added snippet you shared but not sure what it does.

    Where do I see the change? mind sharing some image of expected result?

    Thank you

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon ,

    If added correctly to the functions.php file or using another method, it should show a “Closure” column on the “All recipes” page like in https://cln.sh/HgJZ9Z. “Yes” indicates that the recipe has a “Live” closure.

    Thread Starter futureyoon

    (@futureyoon)

    Thank you for the screeenshot. Yes indeed it shows the status.

    Now the issue is getting into next level. In fact, that was the original issue.

    Please take a look.

    somehow uoa_redirect runs every x sec (maybe a min). Is this expected to run? or it shouldn’t run?

    Please kindly confirm and let me know how to address this if it’s an issue.

    Thank you

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon ,

    Here’s the feedback from our development team:

    It is expected to run like that because a flag could get set for a user in the background by submitting an ajax call, or the recipe might get completed during an ajax call, which sets a flag for the user to be redirected to the URL set in the recipe.

    Having said that, we are also exploring an efficient way of doing it.

    We are planning some changes to “closures” like this in Q1 to make things more efficient, but hopefully the above explains why this behaviour is set up as it is.

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon , for now we will close this ticket since it’s been open for a week, but we have been working on some closures changes. Those are still scheduled for Q1.

    Thread Starter futureyoon

    (@futureyoon)

    while waiting for the update in Q1, just quick check,

    is there a quick snippet to run the uoa redirect script only on the certain pages?

    Thank you

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon ,

    We’ll add a change in the next release that will allow it. For now, you can grab the updated file from https://we.tl/t-k9hB8WujLA.

    Replace the existing version by FTP at this path:

    \wp-content\plugins\uncanny-automator\src\class-automator-load.php

    Once updated, it allows the following filter:

    apply_filters( ‘automator_run_closure_uoa_redirect’, true, $post, $user_id )

    And here’s a code sample:

    add_filter( ‘automator_run_closure_uoa_redirect’, function( $bool, $post, $user_id ){
    if( ! $post instanceof WP_Post){
    return $bool;
    }
    if( 1234 === $post->ID ){
    return false;
    }

    //if(‘my_post_type’ !== $post->post_type){
    //return false;
    //}
    return $bool;
    }, 20, 3);

    Thread Starter futureyoon

    (@futureyoon)

    Thank you so much! I will give it a shot!

    Just quick validation for the sample code

    what if i wish to make uoa disable on the specific page? (e.g. page id 10313)

    or the other way around

    wish to make uoa run on the specific page? (e.g. page id 10418)

    • This reply was modified 1 year, 10 months ago by futureyoon.
    • This reply was modified 1 year, 10 months ago by futureyoon.
    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon , our developer says you could try adapting the code sample below for what you want to do:

    -
    add_filter(‘automator_run_closure_uoa_redirect’, function ($bool, $post, $user_id)
    {
        if (!$post instanceof WP_Post)
        {
            return $bool;
        }
    
        if (1234 === $post->ID) // to disable on specific post/page id update the '1234' to the desired ID.
        {
            return false;
        }
    
       	if( strstr($_SERVER['REQUEST_URI'], '/your-page-slug-here/') ) // to disable on specific URL. Update 'your-page-slug-here' to the desired page SLUG.
       	{
       		return false;
       	}
    
        return $bool;
    }, 20, 3);
    
    -
    Thread Starter futureyoon

    (@futureyoon)

    Thank you very much for the sample codes. I got it.

    Is it possible to make the uoa redirect disable for everywhere but specific ID / page?

    However, the sample codes seems working opposite ways – uoa works everywhere except on those IDs and pages that were identified.

    What if I just need to ensure this uoa works on the singple page, then I will have to list down all IDs and pages except 1. That seems bit inefficient way to achieve the goal.

    I hope you can help convey the message to the developers before they release it to live.

    Thank you

    Plugin Contributor Uncanny Automator

    (@uncannyautomator)

    Hi @futureyoon ,

    Our developer says you could try this instead:

    -
    add_filter(‘automator_run_closure_uoa_redirect’, function ($bool, $post, $user_id)
    {
        if ( !$post instanceof WP_Post )
        {
            return $bool;
        }
    
        if ( ! in_array( $post->ID, array( 1, 2, 3 ), true ) ) // to disable everywhere except these IDs.
        {
            return false;
        }
    
    
        return $bool;
    }, 20, 3);
    
    -
Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘uoa_redirect/’ is closed to new replies.