Article statistics showing 0 abstract views and 0 PDF downloads

Fatal error: Call to undefined function import() in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/UsageStatsHandler.inc.php on line 16


Fatal error: Call to undefined function import() in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/PKPUsageStatsPlugin.inc.php on line 16


Fatal error: Call to undefined function import() in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/PKPUsageStatsReportPlugin.inc.php on line 17

Can you clarify where you are seeing the error messages, for example “Fatal error: Call to undefined function import() in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/UsageStatsHandler.inc.php on line 16” ?

On my file manager. When I try to open it.

My todays Log File. Kindly do let me know.

It sounds like your file manager is trying to lint the PHP files when opened for editing. These errors can be ignored.

I don’t see any relevant Fatal errors in the PHP error log file you linked. (There is a fatal error for a different bug, and a lot of warnings which could be suppressed by turning off strict standards).

Can you also post your latest Usagestatisticsfileloadertask*.log from the scheduledTaskLogs folder?

[2017-01-19 20:26:17] http://pkp.sfu.ca/ojs
[2017-01-19 20:26:17] [Notice] Task process started.

This is one from 19th Jan. Before it, there is from 8th Jan. I guess, I must have deleted them from the administration. The log file from the same timings is in the next post.

Also when I ran cron - this error came

Parse error: syntax error, unexpected ‘version’ (T_STRING) in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/scheduledTasks.xml on line 1

[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of LensGalleyPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/lensGalley/LensGalleyPlugin.inc.php on line 18
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of GoogleAnalyticsPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/googleAnalytics/GoogleAnalyticsPlugin.inc.php on line 147
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of OrcidProfilePlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 413
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of BrowsePlugin::manage() should be compatible with Plugin::manage($args, $request) in /home/u796555399/public_html/plugins/generic/browse/BrowsePlugin.inc.php on line 151
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of BrowsePlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/browse/BrowsePlugin.inc.php on line 151
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of RecommendByAuthorPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/recommendByAuthor/RecommendByAuthorPlugin.inc.php on line 156
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of PdfJsViewerPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/pdfJsViewer/PdfJsViewerPlugin.inc.php on line 141
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of WebFeedPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/webFeed/WebFeedPlugin.inc.php on line 190
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/plugins/ThemePlugin.inc.php on line 372
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/classes/core/Request.inc.php on line 68
[19-Jan-2017 20:26:17 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en_US.js) is not within the allowed path(s): (/home/u796555399:/tmp:/var/tmp:/opt/php-5.6/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/u796555399/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 568
[19-Jan-2017 20:26:17 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en.js) is not within the allowed path(s): (/home/u796555399:/tmp:/var/tmp:/opt/php-5.6/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/u796555399/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 568
[19-Jan-2017 20:26:17 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en_US.js) is not within the allowed path(s): (/home/u796555399:/tmp:/var/tmp:/opt/php-5.6/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/u796555399/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 585
[19-Jan-2017 20:26:17 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en.js) is not within the allowed path(s): (/home/u796555399:/tmp:/var/tmp:/opt/php-5.6/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/u796555399/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 585
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home/u796555399/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 130
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of WebFeedBlockPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/u796555399/public_html/plugins/generic/webFeed/WebFeedBlockPlugin.inc.php on line 105
[19-Jan-2017 20:26:17 UTC] PHP Strict Standards: Declaration of ManagementHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /home/u796555399/public_html/lib/pkp/pages/management/ManagementHandler.inc.php on line 19
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method Core::removeBaseUrl() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/plugins/generic/usageStats/PKPUsageStatsLoader.inc.php on line 508
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method Core::_getBaseUrlAndPath() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/core/Core.inc.php on line 256
[19-Jan-2017 20:26:17 UTC] PHP Deprecated: Non-static method Config::getContextBaseUrls() should not be called statically, assuming $this from incompatible context in /home/u796555399/public_html/lib/pkp/classes/core/Core.inc.php on line 313
[19-Jan-2017 20:26:17 UTC] ojs2: DB Error: Duplicate entry ‘1’ for key ‘PRIMARY’

Kindly have a look on my latest posts.

This log indicates that the task started but never completed.

This error looks like a probable cause for the task not completing. What does that file look like on your system? It should look like this:

@varshilmehta,

Maybe here as well, for the others to know: Your DB table usage_stats_temporary_records has some wrong indexes/primary key defined, which leads to the DB error duplicate primary key, so that statistics can not be inserted. You should remove the indexes and then move the unprocessed log files into the folder usageEventLogs, so that they can be processed again.

Best,
Bozana

1 Like

Thanks Bozana. Its now sworking. Thanks a lot bro. You are an awesome person. God bless you.

Glad to hear that! Thanks! :slight_smile:

Hi @bozana,

We have upgraded from 2.4.6 to 3.0.1. In the old version below code used to work for PDF download count before the statistics framework change in some earlier 2.X:

$metricsDao =& DAORegistry::getDAO('MetricsDAO');
$result = $metricsDao->getMetrics("ojs::legacyDefault",
                        array(STATISTICS_DIMENSION_ASSOC_ID),
                        array(STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_GALLEY, STATISTICS_DIMENSION_SUBMISSION_ID => $this->getId())); 
return $result[0][STATISTICS_METRIC];

Now result array returns null. What needs to be changed?

Regards
Ghazal

Hi @salehig

Hmmm… I am not sure…

There is no ASSOC_TYPE_GALLEY any more. Instead ASSOC_TYPE_SUBMISSION_FILE should be used.

But I am not sure if that would work… I’ll take a deeper look and try to figure it out…

The new version OJS 3.0.2 fixes a few bugs of the statistics plugin, so it would be good to wait for it however…

Best,
Bozana

I figured that out!!!

Legacy galley count:
$filter = array (STATISTICS_DIMENSION_REPRESENTATION_ID => $this->getBestGalleyId()); $result = $metricsDao->getMetrics($metricType, array(STATISTICS_DIMENSION_ASSOC_ID), $filter);

non-legacy galley count:
$application->getPrimaryMetricByAssoc(ASSOC_TYPE_SUBMISSION_FILE, $this->getFileId());

Is that correct?

Hi @salehig

The non-legacy is definitely correct, but for legacy I am not sure, could be :slight_smile: Have you tried out?

Thanks!
Bozana

Yes the figures seems right to me :slight_smile:

Hi! The issues with not displaying downloads stats are gone now after the upgrade to 3.0.2. But the problem with not displaying any data for the current year is still there. Recently I’ve found the following in the logs:

[2017-02-04 22:05:40] [Notice] Task process started.
[2017-02-04 22:05:40] [Warning] Usage statistics plugin is disabled. No log files processed.
[2017-02-04 22:05:40] [Notice] Task process stopped.

I had to enable the plugin again for each journal one by one. But I am still not sure if it works at all. Since we do not have any statistics in the metrics table since the end of 2016 (see above) :worried:

Now I am experimenting by enabling the Acron plugin for one of our journals. But I still do not see any changes. Please, help!

Hi @Ph_We

It will take a day for statistics to be calculated and stored in the database table metrics. You could double check if the current access is correctly logged in the usage statistics log file (the file with the current date in the name, in files folder > usageStats/usageEventLogs/). If so, see tomorrow if there are appropriate entries in the DB table metrics.

Best,
Bozana

Hi @bozana,

Something mysterious is happening here. Two days have passed after I activated the Acron plugin. We do have usage statistics log files with current dates in usageStats/usageEventLogs. But we still do not have anything of that sort in the metrics table :confused:
All the appropriate plugins seem to be activated and functional. Do you have any suggestions?

Below is an excerpt from our current log. Notice, that the IP always stays the same. May that cause such problems?

[details=log]> 10.0.8.1 administrative 22 “2017-02-08 00:17:35” http://ojs.hse.ru/index.php/ecsoc/index 200 “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:51.0) Gecko/20100101 Firefox/51.0”

10.0.8.1 administrative 22 “2017-02-08 00:20:08” http://ojs.hse.ru/index.php/ecsoc/index 200 “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:51.0) Gecko/20100101 Firefox/51.0”
10.0.8.1 bot - “2017-02-08 00:25:41” http://philosophy.hse.ru/index 200 “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
10.0.8.1 - - “2017-02-08 00:36:55” http://philosophy.hse.ru/index 200 “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1”
10.0.8.1 bot - “2017-02-08 01:56:52” http://ojs.hse.ru/index.php/sociologica/article/view/323 200 “Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
10.0.8.1 bot - “2017-02-08 02:22:21” http://ojs.hse.ru/index.php/sociologica/article/view/338 200 “Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
10.0.8.1 bot - “2017-02-08 02:32:25” http://ojs.hse.ru/index.php/sociologica/article/view/220 200 “Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
10.0.8.1 - - “2017-02-08 03:07:53” http://philosophy.hse.ru/index 200 “Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13D15 Safari/601.1”
10.0.8.1 bot - “2017-02-08 03:17:52” http://philosophy.hse.ru/index 200 “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
10.0.8.1 bot - “2017-02-08 03:21:13” http://ojs.hse.ru/index.php/jle/index 200 “Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots)”

10.0.8.1 - - “2017-02-08 09:33:25” http://ojs.hse.ru/index.php/jle/article/view/1364 200 “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1678.0 Safari/537.36”
10.0.8.1 - - “2017-02-08 09:33:54” http://ojs.hse.ru/index.php/jle/article/download/1364/1996/2685 200 “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1678.0 Safari/537.36”
10.0.8.1 - - “2017-02-08 09:33:55” http://ojs.hse.ru/index.php/jle/article/download/1364/1996/2685 200 “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0”
10.0.8.1 - - “2017-02-08 09:34:35” http://ojs.hse.ru/index.php/jle/article/view/1364 200 “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1678.0 Safari/537.36”
[/details]