Forum Replies Created

Viewing 15 replies - 1 through 15 (of 140 total)
  • Thread Starter coldrealms65

    (@coldrealms65)

    I ended up deactivating the plugin for now.

    I realized where it was getting the erroneous information, It was reading from another site hosted on my server.
    Executing at a level that can see other information not limited by the php user (most likely due to shell_exec) makes this whole system far far to insecure to be used in its current state so I removed it.

    Have you tested this on a multi-tenent nginx system?

    Thread Starter coldrealms65

    (@coldrealms65)

    I will note, that the default test works and shows the cached page, but the dd thing is the “found unsupported” even when things appear to work normally with the default

    Thread Starter coldrealms65

    (@coldrealms65)

    That worked, thanks.
    Messed around with the regex for my unusual key setup and couldn’t get it to work, but then even after resetting it to default and changing the keys on the test site to the default format –

        fastcgi_cache_key "$scheme$request_method$host$request_uri";

    It still shows an error. Can we move this to email so I can shoot you some images and chat privately?

    Thread Starter coldrealms65

    (@coldrealms65)

    Sorry I missed this, have been ill all week.

    I’ll have a go at the 2.0.7 version in a bit and get back to you

    Thread Starter coldrealms65

    (@coldrealms65)

    As a non-plugin developer I have a few, probably silly, questions:

    If the plugin generates the file list dynamically what is the reason the regex isn’t stored, then pulled, from a database option with a hardcoded fallback like other saved options? Why is it only hardcoded?

    For the shell_exec: curl seems to work, but again as a plugin/ coder novice I really have no idea the why and why not, but wouldn’t this do it?

    $output = preload_cache_with_curl(
    $fdomain,
    $tmp_path,
    $nginx_cache_limit_rate,
    $nginx_cache_wait,
    $nginx_cache_reject_regex,
    $nginx_cache_reject_extension
    );
    function preload_cache_with_curl($url, $tmp_path, $limit_rate, $wait_time, $reject_regex, $reject_extension) {
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_USERAGENT, NPPP_USER_AGENT);

    // Custom headers and options
    $headers = [
    'Cache-Control: no-cache',
    'Pragma: no-cache'
    ];
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    // Execute and get the response
    $response = curl_exec($ch);

    if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    curl_close($ch);
    return $error_msg;
    }

    curl_close($ch);
    return $response;
    }

    If I am completely off base, as a newb I accept that I am just trying to be helpful :), please feel free to disregard, it won’t hurt my feelings.

    Thread Starter coldrealms65

    (@coldrealms65)

    Thanks for the response, looking forward to potential changes.

    With regards to the following:

    Honestly, I’ve already tried to handle this case, but due to the limitations in determining and adjusting the plugin code’s regex to match the user’s actual fastcgi_cache_key format, it’s not an easy task.

    To gather accurate data for the ADVANCED tab, NPP currently use common fixed format?$scheme$request_method$host$request_uri?via regex;

    Could you add an advanced option to have the user supply their own regex? A toggle or even fallback that would use your base key format and still allow the user to set their own for their specific use?

    Explain that any non-standard regex will not receive official support.

    Mainly,?shell_exec?is essential for core functionality—Cache Preloading—because the Cache Preload action relies on the native?wget?command. Additionally,?shell_exec?is necessary for important pre-checks that NPP performs exclusively on Nginx web servers running on Linux-based systems; otherwise, it will disable itself.

    As shell_exec is such a serious security issue there should be a way to get around this. For the time being I am a fan of options so perhaps a toggle to disable those features that need shell_exec? Have in the setup to enable shell_exec while configuring the plugin so the tests can run. Inform them that the preload requires shell_exec so the user can make that choice.

    In the meantime I will be looking for a way to do the preload without shell_exec.

    New question – does the plugin tie into the action hooks for wp rocket or any other cache systems so that when they trigger a cache purge so does your plugin? If not, I know that Adame and his team from wp rocket are really good about helping plugin devs hook into their actions

    Thread Starter coldrealms65

    (@coldrealms65)

    You are most welcome. I was so excited when I got this to work ??

    coldrealms65

    (@coldrealms65)

    Any word on getting this fix pushed live?

    I tried to put in the updated function but it just crashed. Rather just wait till the dev fixes it ??

    Thread Starter coldrealms65

    (@coldrealms65)

    whatever the latest wordpress is and php 8.3

    • This reply was modified 5 months, 3 weeks ago by coldrealms65.
    Thread Starter coldrealms65

    (@coldrealms65)

    So it looks like there is some issues with the basic Buddy press template packs. Legacy works for the changes you described however Nouveau is overriding your plugin’s activity feed settings.

    We have to use Nouveau due to theme requirements so any thoughts on how to make your activity compatible with Nouveau?

    Thread Starter coldrealms65

    (@coldrealms65)

    Thanks for the reply.

    So in this section:

    function bp_docs_format_activity_action_bp_doc_created( $action, $activity ) {
    if ( empty( $activity->secondary_item_id ) ) {
    return $action;
    }

    $doc = get_post( $activity->secondary_item_id );
    if ( ! $doc ) {
    return $action;
    }

    $user_link = bp_core_get_userlink( $activity->user_id );

    $doc_url = bp_docs_get_doc_link( $activity->secondary_item_id );
    $doc_link = sprintf( '<a href="%s">%s</a>', $doc_url, $doc->post_title );

    $action = sprintf( __( '%1$s created the doc %2$s', 'buddypress-docs' ), $user_link, $doc_link );

    return $action;

    }

    I assume i would add something like:

    function bp_docs_format_activity_action_bp_doc_created( $action, $activity ) {
    if ( empty( $activity->secondary_item_id ) ) {
    return $action;
    }

    $doc = get_post( $activity->secondary_item_id );
    if ( ! $doc ) {
    return $action;
    }

    $user_link = bp_core_get_userlink( $activity->user_id );

    $doc_url = bp_docs_get_doc_link( $activity->secondary_item_id );
    $doc_link = sprintf( '<a href="%s">%s</a>', $doc_url, $doc->post_title );

    // Get the excerpt of the document
    $doc_excerpt = $doc->post_excerpt;

    // If the excerpt is empty, generate one from the content
    if ( empty( $doc_excerpt ) ) {
    $doc_excerpt = wp_trim_words( $doc->post_content, 55, '...' );
    }

    $action = sprintf( __( '%1$s created the doc %2$s: %3$s', 'buddypress-docs' ), $user_link, $doc_link, $doc_excerpt );

    return $action;
    }

    But, I am only as good a programmer as my ability to ask chatgpt so i don’t know if that5 is even close to correct ??

    Thread Starter coldrealms65

    (@coldrealms65)

    nevermind. I figured out.

    Thread Starter coldrealms65

    (@coldrealms65)

    question adjacent:
    Is this possible?

    • Is it possible when someone adds a new doc to have the description in the activity feed? So it doesn’t just say the doc name and that it was posted? When a comment is posted, it shows the comment in the feed. Would be nice to have some kind of description of docs posted as well.?
    coldrealms65

    (@coldrealms65)

    Is there a way to set this to something more useful like a few minutes?

    Thread Starter coldrealms65

    (@coldrealms65)

    I can add that on desktop the add to cart button takes about 1 second to do what it does, yet on mobile it is nearly instantaneous. I suspect that is an indicator of what is wrong….

Viewing 15 replies - 1 through 15 (of 140 total)