October 22, 2024
Chicago 12, Melborne City, USA
PHP

how change schema product yoast on image?

I noticed that the Google snippet does not display a photo of the product. I changed the plugin code, but the test showed no results. plugin Yoast SEO: WooCommerce code protected function filter_variations( $data, $product ) { if ( ! isset( $data['offers'] ) || $data['offers'] === [] ) { return $data; } $data['@type'] = 'ProductGroup';

Read More
PHP

How to check if two unix timestamps are included in five minutes by using DateTime Class

How to check in PHP if 2 unix timestamps are in a range on 5 minutes by using DateTime Class? I’m refering to five minutes of clock, not (5*60 secs). When exactly the minute passes when you look at the system clock. So it could be for example a range from 04:59 to 05:04. In

Read More
PHP

When execute multiple ajax function in async way. PHP response in sync way

Here show js function, But my response received from PHP which is in sequence. So I expecting queries to execute all in one go. PHP queries public function get_filtered_data_01(){...} public function get_filtered_data_02(){...} JS query //Example ajax query 01 as like below we have few more query function load_filtered_data_1(data_params) { $.ajax({.....}); } async function loadAllFilters(data_params) {

Read More
PHP

Laravel can't get redis key value on For loop

I had a problem with Laravel when get a Redis value on loop public function testLoop() { for($i = 0; $i < 3; $i++) { Redis::set('key_'.$i, 'value_'.$i); Log::info(Redis::get('key_'.$i)); } return true; } Laravel successfully set the key but any error on get key here is the logs, only get the first key [2024-10-21 09:05:13] local.INFO:

Read More
PHP

Unable to Store Chinese Character '𧗽' in MySQL with utf8mb4 Charset

I’m facing an issue while trying to store the Chinese character ‘𧗽’ (U+275FD) in a MySQL database table that uses the utf8mb4 character set. I have verified that both the database and the specific table are set to utf8mb4, but I’m still receiving an error when attempting to insert this character. Here are the details

Read More
PHP

Get list of private Dailymotion videos

I want to get list of private Dailymotion videos. I am able to receive an access token with a private key. But then when I send Get request to retrieve the list of videos, I see the following "400 Bad Request: malformed Host header". <?php //Perform authentication // Specify the URL and data $url =

Read More
PHP

How to Escape Inline Scripts in WordPress Plugins to Prevent Rejection

I am currently uploading my custom WordPress plugin but it has been rejected twice due to security issues The primary problem is related to inline scripts that I am adding using wp_add_inline_script. Below is the response I received from the WordPress review team: Variables and options must be escaped when echoed Much related to sanitizing

Read More
PHP

How to create a table on button click in Yii2

I need to create a new table instance by clicking on the button.Each new created table has its own unique name .As far as I understand I need firstly to get action function in controller then bind it to button. But how could I manipulate new created table if only table not its model is

Read More
PHP

Laragon Virtual Host doesn't work for Laravel App

I know this question maybe duplicate, but from any answers and questions that I have looked at, no one of them can solve my problem. I use Laragon for my Laravel App project and i want to open the project by using the virtual host. I think I have changed the version of PHP on

Read More
PHP

How to get &curren to display literally, not as an HTML entity

I have a string like this: $params="currency=EUR&externalPlayerId=1&country=BE&language=EN&platform=WEB&playMode=DEMO&secureLogin=xctr_xcasters&symbol=vs50aladdin"; I will convert this string to an array: $array1 = explode('&', $params); Result is: Array ( [0] => currency=EUR [1] => externalPlayerId=1 [2] => country=BE [3] => language=EN [4] => platform=WEB [5] => playMode=DEMO [6] => secureLogin=xctr_xcasters [7] => symbol=vs50aladdin ) Now i want to sort this aphabetic:

Read More