Salvatore Noschese
Forum Replies Created
-
Forum: Plugins
In reply to: [LiteSpeed Cache] today I disabled this pluginThe 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);}- This reply was modified 1 day ago by Salvatore Noschese.
- This reply was modified 1 day ago by Salvatore Noschese.
Forum: Plugins
In reply to: [LiteSpeed Cache] today I disabled this plugintried 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 ??
- This reply was modified 1 day, 16 hours ago by Salvatore Noschese.
Forum: Developing with WordPress
In reply to: Plugin translation and text-domain@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”.
Forum: Developing with WordPress
In reply to: Plugin translation and text-domainty 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.
Forum: Plugins
In reply to: [External Links in New Window / New Tab] I don’t want to be rude but…Ok, TYSM, really appreciated. Best regards.
Forum: Plugins
In reply to: [External Links in New Window / New Tab] I don’t want to be rude but…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! ??
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.
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.
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 ).
Forum: Plugins
In reply to: [LiteSpeed Cache] Litespeed Cache: Persistent Cache Issuesno. I deleted cloudflare more time ago.
and quick loud is active only for optimization.
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 ????
Forum: Developing with WordPress
In reply to: CPT, new_item labelty so much for reply . So, with a single site Is ok i cannot see it. ????
Forum: Developing with WordPress
In reply to: Preg replace in contentfinally, 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);
}
}Forum: Developing with WordPress
In reply to: Preg replace in contenttried 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 ????