V.E.L
Forum Replies Created
-
Forum: Plugins
In reply to: [Autoptimize] base64 svg+xml link for lazyloadworks like a charm! thank you very much! and SEO scanner stops complaining now ??
this is the code:
add_filter( 'autoptimize_filter_imgopt_lazyload_placeholder', 'AOReplaceHolder' ); function AOReplaceHolder($in) { $ao_placeholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkqAcAAIUAgUW0RjgAAAAASUVORK5CYII='; return $ao_placeholder; };
- This reply was modified 5 years, 6 months ago by V.E.L.
Forum: Plugins
In reply to: [Autoptimize] base64 svg+xml link for lazyloadAh, good to know, can you show me proper example and on which hook should i call this in functions.php?
many thanks! @optimizingmatters
many thanks!!
Excellent, thanks! I’ll try the same, cheers ??
Forum: Plugins
In reply to: [Autoptimize] Feature RequestExcellent, the hook works flawlessly. Thank you for that, and also for considering the request ??
cheers.
hi @ethanchoi
Problems solved now. I checked it out by installing fresh WP with no plugins and no options with only WPForms, turns out, this is the problem:
WPForm requires reCaptcha to be called with query string like this:
<script type='text/javascript' src='https://www.google.com/recaptcha/api.js?onload=wpformsRecaptchaLoad&render=explicit&ver=2.0.0'></script>
While I have custom function to remove query string from static resources, and the result was this:
<script type='text/javascript' src='https://www.google.com/recaptcha/api.js'></script>
So now I made expection for the
recaptcha/api.js
and everything works fine now. ??Thanks a lot for your support! ??
FYI, this is my function:
function cleanup_query_string( $src ){ if ( stristr( $src, "google.com/recaptcha/api.js" ) ) { return $src; } else { $parts = explode( '?', $src ); return $parts[0]; }; } add_filter( 'script_loader_src', 'cleanup_query_string', 15, 1 );
- This reply was modified 5 years, 6 months ago by V.E.L.
hi @ethanchoi,
Support ticked submitted, thank you for your suggestion ??
By the way, No-Conflict mode not working, and I don’t have other form-related plugin such as contact form 7, and i’m using Salient theme which i don’t see any recaptcha features built in it. can you enlighten me (from view source window) which recaptcha belongs to WPForms and which one is not?
thanks!
Yes, requested, and updated.
many thanks ??
Hi @mbis
this time works as expected, sometimes it still generates duplicate custom URI (not native slug) after “Save” in single post editor, but that’s fine since we can fix it easily from Tools>Permalink Manager screen.
I tested regenerate/reset with all options available, perfect results, no more duplicates, and word trim works just fine.
many thanks for this!
Hi @mbis
everything works, no more duplicates now, and I have all your functions and filter placed, tested with single post, works, but “pm_trim_native_slug” doesn’t affect regenerate/reset. result still giving me original slug made by wordpress (very long one), should i call the function from another hook?
This is the screenshot:
https://i.imgur.com/OTqlbiP.pngThis is the code in my functions.php:
add_filter( 'permalink_manager_fix_uri_duplicates', '__return_true' ); function pm_trim_native_slug($slug) { $max_words = 10; $words = explode('-', $slug); if(count($words) > $max_words) { $slug = implode("-", array_slice($words, 0, $max_words)); } return $slug; } add_filter('pre_wp_unique_post_slug', 'pm_trim_native_slug'); function pm_trim_custom_url($uri) { $max_words = 10; $new_title = ''; $slugs = explode('/', $uri); for($i=0, $count = count($slugs); $i < $count; $i++) { $slug = $slugs[$i]; $words = explode('-', $slug); $new_title .= "/"; if(count($words) > $max_words) { $new_title .= implode("-", array_slice($words, 0, $max_words)); } else { $new_title .= $slug; }; }; $new_title = trim($new_title, "/"); return $new_title; }; add_filter( 'permalink_manager_filter_default_post_uri', 'pm_trim_custom_url', 99 ); add_filter( 'permalink_manager_filter_default_term_uri', 'pm_trim_custom_url', 99 );
thank you
- This reply was modified 5 years, 6 months ago by V.E.L.
Hi @mbis
many thanks!, i added the filter now… about the native slug, in the screenshot if you see the old one and new one are the same (very long, words not trimmed), I was expecting that regenerating/reset will also execute the custom snippet you gave me before (to trim the words). So the new native slug URI will have words trimmed out of it.
thank you
Forum: Plugins
In reply to: [Permalink Manager Lite] Feature request: limit slug character lengthHi @mbis
Yes of course, this is the screenshot:
https://i.imgur.com/pxmB8HL.pngThe problem:
1) I selected “Regenerate native slug”, but instead, i got new custom URLs and native slugs remains the same.2) The new generated URL doesn’t check for duplicates. so the link are all the same. i think the WordPress native slug always check for duplicates and adds number behind the URL if found.
many thanks! ??
Forum: Plugins
In reply to: [Permalink Manager Lite] Feature request: limit slug character lengthHello @mbis
many thanks! i tried that function and it works for new post and edit post… but it doesn’t work with “Regenerate/Reset”, how can i apply same function to regenerate/reset as well?
thanks!
Forum: Plugins
In reply to: [Permalink Manager Lite] Feature request: limit slug character lengthnevermind, don’t answer, found another socmed sharing plugin that fully supports CSP3. thanks!