| Server IP : 167.99.224.18 / Your IP : 216.73.216.136 Web Server : Apache/2.4.41 (Ubuntu) System : Linux wordpress-ubuntu-s-1vcpu-1gb-nyc1-01 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.0.25 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins-old/matomo/classes/WpMatomo/Ecommerce/ |
Upload File : |
<?php
namespace WpMatomo\Ecommerce;
/**
* this class is required only for phpunit tests.
* It allow to change the visibility of some methods of the Base class
* and so allow to test them in the unit tests
*
* phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod.Found
*/
class MatomoTestEcommerce extends Base {
public $should_track_background = false;
public $supports_delayed_tracking = false;
public $session_data = [];
public $tracked_orders = [];
/**
* Render public the wrap_script method. Required for the unit tests
*
* @param string $script
*
* @return string
* @see Base::wrap_script()
*/
public function wrap_script( $script ) {
return parent::wrap_script( $script );
}
/**
* Render public the wrap_script method. Required for the unit tests
*
* @param [] $params
*
* @return string
* @see Base::make_matomo_js_tracker_call()
*/
public function make_matomo_js_tracker_call( $params ) {
return parent::make_matomo_js_tracker_call( $params );
}
protected function should_track_background() {
return $this->should_track_background;
}
protected function get_tracking_calls_in_session() {
return $this->session_data['ajax_calls'];
}
protected function add_tracking_calls_to_session( $data ) {
$this->session_data['ajax_calls'][] = $data;
}
protected function remove_tracking_calls_in_session() {
$this->session_data['ajax_calls'] = [];
}
/**
* @return bool
*/
public function supports_delayed_tracking() {
return $this->supports_delayed_tracking;
}
public function set_order_been_tracked( $order_id ) {
$this->tracked_orders[] = $order_id;
}
public function has_order_been_tracked_already( $order_id ) {
return in_array( $order_id, $this->tracked_orders, true );
}
}