robert7k
Forum Replies Created
-
Forum: Plugins
In reply to: [Redirection] regex redirect to other domain failsok… sorry. i get it.
Thanks!
tickets IS a valid regex match, i’ve expected it to just to redirect to target url, not to do regex replacement.
anyways, i’ve fixed my problem using .*tickets.*- This reply was modified 4 years ago by robert7k.
Forum: Plugins
In reply to: [Redirection] regex redirect to other domain failsagain… my regex expression is tickets
(i enable regex just to enable substring match)
my target is https://tickets.example.com
and the log:
Forum: Plugins
In reply to: [Sublanguage] importing multi language posts with metadataFixed in a future version. Thanks!
Forum: Plugins
In reply to: [Sublanguage] importing multi language posts with metadatap.s. this code doesn’t do anything because of another bug (that requires specifying post_type) – but I already have a solution for that bug
Forum: Plugins
In reply to: [Translate Multilingual sites - TranslatePress] Get translated stringno idea about security.
Yes, it was a typo. this is a part of the code i currently use:$trp_instance = TRP_Translate_Press::get_trp_instance(); $translator = $trp_instance->get_component('translation_render'); $translator_original_language = $trp_instance->get_component('settings')->get_setting('default-language'); if (get_locale()!==$translator_original_language) { $translation = $translator->process_strings(array($original_name),get_locale()); if ($translation) $new_name = $translation[0]; }
after experimenting with this kind of code just open the translatepress settings to make sure no scary errors show up (wrong code got me errors about missing sql tables!!!)
- This reply was modified 4 years, 8 months ago by robert7k.
Forum: Plugins
In reply to: [Translate Multilingual sites - TranslatePress] translate reply emailsyes, use the shortcode:
https://translatepress.com/docs/translation-shortcode/Forum: Plugins
In reply to: [Translate Multilingual sites - TranslatePress] Get translated stringThis hack kind-of works for me:
if ( class_exists( 'TRP_Translate_Press' ) ){ $target_language = get_locale(); $translator = TRP_Translate_Press::get_trp_instance()->get_component('translation_render'); $translation = $translator->process_strings(array($original_name),target_language); if ($translation) $new_name = $translation[0];}
But be warned – this hack isn’t stable – you should filter your input – bad input can cause exceptions or even sql injection vulnerabilities (the target language must exist in your translatepress and can’t be the default language). It also may slow down your site (i didn’t test the preformance of this ugly hack)
i’m waiting for a reply too (hopefully to get better code).
it’s a very old problem.
It happens usually on sites that use translatepress + woocommerce + a caching plugin.
In my case it was wprocket and clearing _transient_rocket_get_refreshed_fragments_cache from the options sql table fixes the problem (but may come back later).
Clearing all of the transients could be the (temporary) solution tooForum: Plugins
In reply to: [Additional Order Filters for WooCommerce] Plugin error shownThis plugin shows many php notices/warning (on php 7.3 with notices/warnings enabled):
on /wp-admin/edit.php?post_type=shop_order
Warning in_array() expects parameter 2 to be array, null given
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:248Notice Undefined variable: output
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:230Notice Undefined variable: opened
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:234Notice Undefined index: post_status
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:246on /wp-admin/edit.php?post_status=wc-completed&post_type=shop_order
Warning count(): Parameter must be an array or an object that implements Countable
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:401Warning Invalid argument supplied for foreach()
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:402Warning in_array() expects parameter 2 to be array, string given
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:248Notice Undefined variable: output
wp-content/plugins/additional-order-filters-for-woocommerce/additionalorderfilters.php:230Those warnings/notices comes mainly because $_GET[‘post_type’] doesn’t exist or not an array if you click on the status filters of woocommerce itself
upgrading from 2.9 to 3.1 (the latest version) still loses all of the settings.
how to reproduce:
1. fresh install WordPress
2. install woocommerce
3. install Digital Goods for WooCommerce Checkout 2.9 (or older)
4. chose to hide address fields
5. check that checkout screen works as expected
6. update Digital Goods for WooCommerce Checkout to latest version (3.1 as of today)
7. go again to the checkout screen – it still asks for address… etc (the expected behavior is to work as in the past if i didn’t change any settings)Forum: Plugins
In reply to: [Gutenberg] Can you make an entire group/section a link?Move everything into a classic editor block and do it there.
Just make sure you have a revisions enabled since it can crash gutenberg after saving and opening the page again in certain cases (and restoring an earlier revision of the page is the only way then)Forum: Plugins
In reply to: [Plugin Load Filter] Not working with WPML?similar issue with translatepress.
In the secondary language all of the plugins are always loaded (like on the 404 page)
with sublanguage it’s even worse – it doesn’t work properly even on the primary language (it thinks i’m on the home page for any page of the site)It happened again.
found it in :
table name: wp_options
option_name: _transient_rocket_get_refreshed_fragments_cache
option_value: {“fragments”:{“div.widget_shopping_cart_content”:”<div class=\”widget_shopping_cart_content\”>\n\n\t<p class=\”woocommerce-mini-cart__empty-message\”>#!trpst#trp-gettext data-trpgettextoriginal=3445#!trpen#No products in the cart.#!trpst#\/trp-gettext#!trpen#<\/p>\n\n\n<\/div>”,”.wc-shopping-cart”:”\n<div class=\”wc-shopping-cart shopping-cart text-disable round-counter-style show-sub-cart\” data-cart-hash=\”#!trpst#trp-gettext data-trpgettextoriginal=11680#!trpen#d68eba15f3f181e94ead3c8e241ca811#!trpst#\/trp-gettext#!trpen#\”>\n\n <i class=\”the7-mw-icon-cart-bold\”><\/i> <span class=\”counter\”>0<\/span><\/a>\n\n <div class=\”shopping-cart-wrap\”>\n <div class=\”shopping-cart-inner\”>\n\t\t\t\n\t\t\t <p class=\”buttons top-position\”>\n\t\t\t\t#!trpst#trp-gettext data-trpgettextoriginal=110#!trpen#View Cart#!trpst#\/trp-gettext#!trpen#<\/a>#!trpst#trp-gettext data-trpgettextoriginal=111#!trpen#Checkout#!trpst#\/trp-gettext#!trpen#<\/a> <\/p>\n\n\t\t\t <ul class=\”cart_list product_list_widget empty\”>\n\t\t\t\t- #!trpst#trp-gettext data-trpgettextoriginal=112#!trpen#No products in the cart.#!trpst#\/trp-gettext#!trpen#<\/li> <\/ul>\n <div class=\”shopping-cart-bottom\” style=\”display: none\”>\n <p class=\”total\”>\n #!trpst#trp-gettext data-trpgettextoriginal=113#!trpen#Subtotal#!trpst#\/trp-gettext#!trpen#:<\/strong> <span class=\”woocommerce-Price-amount amount\”><span class=\”woocommerce-Price-currencySymbol\”>₪<\/span>0.00<\/span> <\/p>\n <p class=\”buttons\”>\n\t\t\t\t\t#!trpst#trp-gettext data-trpgettextoriginal=110#!trpen#View Cart#!trpst#\/trp-gettext#!trpen#<\/a>#!trpst#trp-gettext data-trpgettextoriginal=111#!trpen#Checkout#!trpst#\/trp-gettext#!trpen#<\/a> <\/p>\n <\/div>\n\t\t\t <\/div>\n <\/div>\n\n<\/div>”},”cart_hash”:””}
All of the translations are kept in the database in …_trp_dictionary_… table , but there is no GUI to retirieve them (i use phpmyadmin)
It is possible to put translated an untranslated text together inside the post itself using [trp_language] shortcodes.or are there any other workarounds?
i tried searching in the entire database for trpst, trp-gettext, data-trpgettextoriginal=1801, etc… (all of them one by one).
At some point you will find it .
if it shows up even while tranlatepress is disabled – it means you need to earch all of the tables of the database expect the _trp_ tables.
If you have any kind of cache – clear it before and after the database search/edit- This reply was modified 6 years, 1 month ago by robert7k.