| Server IP : 38.190.208.107 / Your IP : 216.73.217.17 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : www ( 1000) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.3/wp-content/plugins/wp-statistics/assets/dev/javascript/pages/ |
Upload File : |
if (wps_js.isset(wps_js.global, 'request_params', 'page') && wps_js.global.request_params.page === "referrals") {
const placeholder = wps_js.rectangle_placeholder();
function renderChart(chartId, searchData) {
const chartElement = document.getElementById(chartId);
if (chartElement) {
const parentElement = jQuery(`#${chartId}`).parent();
if (!searchData?.data?.datasets || searchData.data.datasets.length === 0) {
parentElement.html(wps_js.no_results());
} else {
jQuery('.wps-postbox-chart--data').removeClass('c-chart__wps-skeleton--legend');
parentElement.removeClass('c-chart__wps-skeleton');
wps_js.new_line_chart(searchData, chartId);
}
}
}
const renderHorizontalChart = (id, data) => {
const chartElement = document.getElementById(id);
if (chartElement) {
const parentElement = jQuery(`#${id}`).parent();
parentElement.find('.wps-ph-item').remove();
parentElement.append(placeholder);
if (!data.data || data.data.length === 0) {
parentElement.html(wps_js.no_results());
} else {
jQuery('.wps-ph-item').remove();
wps_js.horizontal_bar(id, data.labels, data.data, data.icons);
}
}
}
if (typeof Wp_Statistics_Referrals_Object !== 'undefined') {
const sourceCategoriesData = Wp_Statistics_Referrals_Object.source_category_chart_data;
renderChart('sourceCategoriesChart', sourceCategoriesData);
const socialMedia = Wp_Statistics_Referrals_Object.social_media_chart_data;
renderChart('socialMediaChart', socialMedia);
const incomeVisitorData = Wp_Statistics_Referrals_Object.search_engine_chart_data;
renderChart('incomeVisitorChart', incomeVisitorData);
const topCountries = Wp_Statistics_Referrals_Object.countries_chart_data;
renderHorizontalChart('referral-top-countries', topCountries);
const topBrowsers = Wp_Statistics_Referrals_Object.browser_chart_data;
renderHorizontalChart('referral-top-browser', topBrowsers);
const deviceType = Wp_Statistics_Referrals_Object.device_chart_data;
renderHorizontalChart('referral-device-type', deviceType);
const visitorChart = Wp_Statistics_Referrals_Object.traffic_chart_data;
renderChart('referralVisitorChart', visitorChart);
const topSocialMedia = Wp_Statistics_Referrals_Object.social_media_chart_data;
renderChart('referral-social-media-chart', topSocialMedia);
const topSearchEngine = Wp_Statistics_Referrals_Object.search_engine_chart_data;
renderChart('referral-search-engines-chart', topSearchEngine);
}
}