Forum Replies Created

Viewing 15 replies - 1 through 15 (of 59 total)
  • Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    The issue only occurs when I share the dvlr link on Facebook and access it through a browser where I’m not logged in.

    In the Facebook app and the in-app browser, there is a continuous loop. However, if I use Firefox, where I am logged in, there are no issues.

    Now, it seems to be working fine even in the in-app browser. I will mark this as resolved, but I think it would be best to include this fix in the next release since it doesn’t seem to cause any issues when using this snippet atm; it just works.

    <?php
    /**
    * Plugin Name: Redirect Loop Fix
    * Description: A small snippet to fix the redirect loop issue caused by the LiteSpeed Cache plugin.
    * Plugin URI: https://www.ads-software.com/support/topic/today-i-disabled-this-plugin/
    */

    /* Prevent direct access */
    defined('ABSPATH') || exit;

    // Redirect fix filter
    add_filter('wp_redirect', function($location, $status) {
    do_action('litespeed_control_set_nocache', 'no cache due to category setting');
    return $location;
    }, 10, 2);}
    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    tried just now (added in as Mu-Plugins).

    set recommended , atm seems to work so good.

    I continue with this or will be fixed in future release? I lost a lot of visitors cause of this ??

    ps: TYSM for quick reply. Really appreciated ??

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    @kallyansin , Sorry, seen only not your message.

    in realty I tried both without any text-domain, and with default. But are still present in po files when I run “import from source”.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    ty for reply. I used just some classic strings like delete, apply, and similar.

    atm I just need to maintain this without see in Poedit. Yep, I can manually remove, but if exist a simplest way to import only string with my custom-textdomain, can be best.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    Ok, TYSM, really appreciated. Best regards.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    To clarify, I wasn’t sure if I wanted to keep that code on my blog to continue forcing users (which, in fact, I removed last night).

    So, I did some research online and came across your plugin. I thought it might be something simple like what I had, but instead, I noticed it has a lot more code.

    This sparked my curiosity, as I wondered if it might offer additional benefits, like more checks or other features.

    I hope this clears up my question.

    Thank you for your time! ??

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    my website Is clean, work with all plugin, tried to disable all manually + via health and check. All work so good here (I just cannot use this plugin). Thanks for support, but I’m ok.

    best regards ,

    S.N.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    Done, still issue.
    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    im sorry, but I cannot see also in menu so, seems to be a role issue in plugin (this don’t add menu via can ‘manage_options’.

    tried to disable all other plugins (except litespeed cache) and still not work.

    is the first time I install a.plugin and cannot see also in backend menu.

    best regards,

    S.N.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    i receive when I click in url from first image (because I cannot found any other page in my backend).

    i’ve some other plugin with ‘manage_options’, // capability check and all work as expected here (so, my user role work as expected ).

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    no. I deleted cloudflare more time ago.

    and quick loud is active only for optimization.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    hi, thanks for reply.

    Anyway, I removed plugin release and installed full release in a subdomain (embed in WordPress dashboard via a custom plugin).

    all work so good now ????

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    ty so much for reply . So, with a single site Is ok i cannot see it. ????

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    finally, fixed with these.

    <?php
    // Deny access if called directly
    defined('ABSPATH') || exit;

    // Apply customization to the content for GitHub Gist embeds.
    add_filter("the_content", "gist_embed_apply_customization");
    function gist_embed_apply_customization($content) {
    // Patterns to match GitHub Gist URLs in HTML and Shortcode blocks
    $patterns = [
    '/\[https:\/\/gist\.github\.com\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)(\?file=([a-zA-Z0-9.]+))?]/i', // Pattern for shortcode without .js
    '/<script src="https:\/\/gist\.github\.com\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\.js(\?file=([a-zA-Z0-9.]+))?"><\/script>/i', // Pattern for HTML with .js
    ];
    // Replace GitHub Gist embeds with custom HTML
    $content = preg_replace_callback($patterns, function($matches) {
    $fileparam = !empty($matches[3]) ? $matches[3] : ''; // support ?file=filename
    $gist_url = "https://gist.github.com/" . $matches[1] . "/" . $matches[2];
    // Return the modified content
    return "
    <script src='" . $gist_url . ".js" . $fileparam . "' data-no-optimize='1'></script>
    <div class='gist-download-button'>
    <a href='" . $gist_url . "/' title='View Gist' class='print-yes' style='display:none'>GoTo: " . $gist_url . "</a>
    <a href='" . $gist_url . "/download' class='print-no'>Download Gist ❤️</a>
    </div>\n";
    }, $content);
    return $content;
    }

    // Check for the class in the final content and enqueue styles if needed
    add_action('wp_enqueue_scripts', 'conditionally_enqueue_gist_styles');
    function conditionally_enqueue_gist_styles() {
    $content = get_the_content();
    if (is_singular() && strpos($content, '<script src="https://gist.github.com/') !== false) {
    $selected_css_file = get_option('gist_embed_selected_css');
    $gistfilemtime = filemtime(GIST_DIR_PATH . "Assets/CSS/GistCustom.css");
    wp_enqueue_style('gist-selectedcss-style', GIST_PLUGIN_URL . 'Assets/CSS/StyleSheets/' . $selected_css_file);
    wp_enqueue_style('gist-customcss-style', GIST_PLUGIN_URL . 'Assets/CSS/GistCustom.css', array(), $gistfilemtime);
    }
    }
    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    tried now also something like this,

    <?php
    // Deny access if called directly
    defined('ABSPATH') || exit;

    // Apply customization to the content for GitHub Gist embeds.
    add_filter("the_content", "gist_embed_apply_customization");
    function gist_embed_apply_customization($content) {
    // Patterns to match GitHub Gist URLs in HTML and Shortcode blocks
    $patterns = [
    '/\[https:\/\/gist\.github\.com\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)(\?file=([a-zA-Z0-9.]+))?]/i', // Pattern for shortcode without .js
    '/<script src="https:\/\/gist\.github\.com\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\.js(\?file=([a-zA-Z0-9.]+))?"><\/script>/i', // Pattern for HTML with .js
    ];

    // Replace GitHub Gist embeds with custom HTML
    $content = preg_replace_callback($patterns, 'replace_gist_embed', $content);

    // Return the modified content
    return $content;
    }

    function replace_gist_embed($matches) {
    $fileparam = !empty($matches[3]) ? $matches[3] : ''; // support ?file=filename
    $gist_url = "https://gist.github.com/" . $matches[1] . "/" . $matches[2];
    if(!empty($matches)) {
    $selected_css_file = get_option('gist_embed_selected_css');
    $gistfilemtime = filemtime(GIST_DIR_PATH . "Assets/CSS/GistCustom.css");
    wp_enqueue_style('gist-selectedcss-style', GIST_PLUGIN_URL . 'Assets/CSS/StyleSheets/' . $selected_css_file);
    wp_enqueue_style('gist-customcss-style', GIST_PLUGIN_URL . 'Assets/CSS/GistCustom.css', array(), $gistfilemtime);
    }
    return "
    <script src='" . $gist_url . ".js" . $fileparam . "' data-no-optimize='1'></script>
    <div class='gist-download-button'>
    <a href='" . $gist_url . "/' title='View Gist' class='print-yes' style='display:none'>GoTo: " . $gist_url . "</a>
    <a href='" . $gist_url . "/download' class='print-no'>Download Gist ❤️</a>
    </div>\n";
    }

    but style are still present in all pages ????

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