Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter shmac

    (@shmac)

    On the topic of errors –
    we are hosted by Kinsta and their logs show:

    2021/09/27 17:33:09 [error] 233#233: *88184 FastCGI sent in stderr: "PHP message: The WC_Session_Handler::nonce_user_logged_out function is deprecated since version 5.3. Replace with WC_Session_Handler::maybe_update_nonce_user_logged_out" while reading response header from upstream, client: 35.184.52.88, server: gumcreekboards.com, request: "GET /wp-admin/admin-ajax.php?action=wc_square_background_sync&nonce=4b35f034d1 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-gumcreekboards.sock:", host: "gumcreekboards.com", referrer: "https://gumcreekboards.com/wp-admin/admin-ajax.php?action=wc_square_background_sync&nonce=4b35f034d1"

    Just a heads up – since it seems to talk about Woocommerce…

    Thread Starter shmac

    (@shmac)

    Your product is not compatible with “VRYN Button Module” by Rajeshkannan MJ (https://divithemedesigner.com/) and “Divi Image Intense” by Superfly (https://besuperfly.com/product/image-intense-plugin/). I have reached out to both of the authors of these plugins and have let them know, but what’s going to stop them from saying, “WooCommerce needs to fix it on their end”?

    So while what you are doing seems functional, I am worried that it might fill up your WP DB with unwanted meta… I would use User Meta Manager Plugin by Jason Lau to check and make sure that those tags aren’t being recreated over and over again as a column in the DB or even WP Data Access by Passionate Programmers. I would assume a solution could simply be achieved by $keys[] = ‘This is your tracking code, please check it at , <a href="http://www.parceldeliveryservice.com">www.parceldeliveryservice.com</a>: {tracking_number}’; or something to that degree… I am not well versed with the PHP syntax… it might be ${tracking_number}, $keys[] = 'some text' . ${tracking_number};, $keys[] = 'some text ${"tracking_number"}';, or any combination of those. I also don’t know if that website URL is static or changing.

    • This reply was modified 5 years, 6 months ago by shmac.
    • This reply was modified 5 years, 6 months ago by shmac.

    Henri (that is a very unique and cool way to spell that name),

    Did you (or someone else) write custom code for your website? If so, could you post the code?

    Can you be more specific as to which page(s)? Is it for registration or for checkout? If I were to try and replicate the order on checkout (provided that’s the page having problems) would that affect your store’s website negatively in any way, before I try it?

    Can you include a means to replicate it? I.e., a link to the site and directions, if any needed, to replicate.

    Hey Dan,

    So the most straight forward answer to your question “What do square brackets do?” is this:

    Looking at the code provided, $keys[] is an empty “data structure” (as it is called in computer science) known as a dictionary. A dictionary in programming has a list of key, value pairs, as would a “dictionary” in the real world – for instance, look up what the word (your word here) means. In php, this gets a little confusing, because what they call an “array” (see example 6) is effectively a glorified dictionary, which is what this most likely will be referred to as in your situation. So the syntax $keys['some text here - 1'] = 'some text here - 2' effectively means, look through the dictionary called keys for a word or phrase called ‘some text here – 1’ and set its value equal to ‘some text here – 2’. When you want to retrieve that value, you would simply say 'some variable name' = $keys['some text here - 1'], which would save ‘some text here – 2’ to that variable. Which from this explanation and the code shown above, I am surprised that the code outputted the correct information, namely the tracking number, seeing that it is in quotes and not with the grave character. From what I can gather, the $keys dictionary is looped over each key and value pair and outputted to the page.

    I don’t know much about wordpress or woocommerce (even though I’ve written child themes and plugins for them), but from what it looks like:

    It seems to be that your code is adding new keys to an already existing dictionary then looped over. HTML is a string (from what I can gather with interacting with it), so there shouldn’t be any reason as to why you couldn’t include it in the value portion of the dictionary. You should be able to simply say $keys[] = "my HTML tags"; (provided that I used the php “array” syntax properly) to add HTML to the email, seeing that the browser will interpret that string and format it accordingly. The only real thing to note is how you go about adding the link… for instance $keys[] = "<a href="www.google.com">Google</a>"; may look like something you would want to do, but that would throw an error, because you would be starting a string, then closing it, then opening it up, and closing it again, with undefined “variables” is what they would probably refer to it as. There are various ways to work around this, by far the easiest way to work around this in this circumstance is to simply use the ‘ (single tics) like so $keys[] = "<a href='www.google.com'>Google</a>.

    If you are unfamiliar with looping over an array / dictionary, what that essentially means is that for every value in the array or dictionary, output the value. Some of the time we would like to output the value of the key as well, which is what they do in your case. They loop through $keys and any key they find in $keys, then say what is the $keys['the key they found']; (value), and then output both.

    In terms of “max size” of an array, stackoverflow has an article on this.

    Hope this helps,
    Shane

    • This reply was modified 5 years, 6 months ago by shmac.
    • This reply was modified 5 years, 6 months ago by shmac.
    • This reply was modified 5 years, 6 months ago by shmac.
    • This reply was modified 5 years, 6 months ago by shmac.
Viewing 7 replies - 1 through 7 (of 7 total)