Most read article plugin for OJS

Hello Team,
How to add most read article plugin in ojs…
Kindly suggest…

Surojit B.

Hi @Surojit_Bera,

The Popular Articles plugin has not been ported to OJS 3. However, I believe @ajnyga may have created something similar with custom coding and may have some suggestions (see How to add most read topics in ojs 3.1?).

Amanda Stevens
Public Knowledge Project Team


Yes we have a site wide “most read articles” section in The code used there is available here: tsvSite/ at master · ajnyga/tsvSite · GitHub.

Some users have tried to change the code so that it would only show hits for a single journal, but for some reason they have not succeeded (to my knowledge). Unfortunately I do not have time to see what the problem is at the moment, but I am planning to do a block plugin based on that code at some point.

Hi @ajnyga
I am using OJS with health sciences theme. Please guide me where should I place the code (tsvSite/ at master · ajnyga/tsvSite · GitHub) to get most read articles on my website.

Here is a very simple block plugin that uses the same code. It basically shows the pdf downloads for top 5 articles of last 7 days. The time limits etc. should be easy to modify.

Hi @ajnyga I am able to install and enable the plugin but it does not reflect any changes on the front page.! Is there anything else I am missing… Thanks


Is the block visible in the Website > Appearance settings? There is a grid there that you use to choose the blocks that are visible in the sidebar (Sidebar Management).

Also, did you upload the plugin to the generic folder? Block plugins go to the blocks folder.

Now, I have made correction as you suggested and
1- Uploaded the plugin into the block folder not in the generic folder
2- and selected the block in website > appearance > sidebar management as well.

But this block is not appearing in the sidebar management as you can see here in my website.




hmm, could be that having the plugin first in the generic folder and enabling it there caused a problem.

Did you rename the folder from mostRead-master to mostRead?

Are you able to access the versions table in your db and see what kind of entry the plugin has there?

I enabled the plugin in one of our journals. Just uploaded the plugin to the blocks folder, enabled from the plugin settigns and moved the block to the sidebar:

(note that I will remove the link and the block in a while)

I have renamed the folder in block plugin and am able to pull the information on my website. It is working now.

Thanks @ajnyga

1 Like

As you can see it is very basic, feel free to modify the code.

1 Like

Please update for new OJS Version 3.1.2

Got below error

PHP Fatal error: Uncaught → Smarty: Unknown resource type ‘plugins-plugins-blocks-mostRead-blocks-mostRead’ ←
thrown in /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php on line 112

Hi all,

I uploaded mostRead plugin in Generic folder and upgraded system installed off. Then the system didn’t work. Then I deleted the mostRead folder in the Generic folder, I tried to upload in Blocks folder. Then the system still didn’t work. I deleted mostRead folder too. Now the system is working but I can not reach the Installed Plugin seciton under the Plugins. The error message is “Acces denied” first and the second message is “undefined”. How can I reach the installed plugins section. Also I can reach the Plugin Gallery.

Thanks in advance.




the mostRead plugin is a block plugin and should not be uploaded to the generic folder.

It could be that your versions database table has a corrupted entry that got there when you moved the plugin to the generic folder and run an upgrade. You could try deleting the line for the mostRead plugin from that table.

I deleted and upgraded with installed off in the config file. But the problem continues. Can there be another solution?

Hi @ajnyga,

I installed your plugin here:
How often should the view number change? Is it every 7 days?
My numbers seem like stuck more than 7 days.

Best regards,

After installing Most read plugin receive in error.log

[25-Apr-2019 20:19:19 Europe/Belgrade] PHP Warning: file_get_contents(plugins/blocks/mostRead/block.tpl): failed to open stream: No such file or directory in /home/ijcadsee/public_html/lib/pkp/classes/template/ on line 35
[25-Apr-2019 20:19:19 Europe/Belgrade] PHP Warning: Smarty error: unable to read resource: "plugins/plugins/blocks/mostRead/blocks/mostRead:block.tpl" in /home/ijcadsee/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/Smarty.class.php on line 1094
[25-Apr-2019 20:19:55 Europe/Belgrade] ojs2: 404 Not Found

The list of most read article is not visible. OJS used.

Hi @ajnyga,

Currently, the plugin shows number of File views on the last 7 days.
Is it possible to use different parameter, such as Total views or Abstract views?

If yes, could you tell me what modification should I make?
Can this options be implemented in the plugin settings?

Thanks for the great plugin!
Best regards,