Add View Counter plugin (OJS 3.4 and 3.5) - #505
Conversation
Adds an entry for the View Counter plugin, which shows each article's abstract views and downloads on summary lists and the article page. Maintained by OJSBR; rewritten from an original OJS 3.3 access/downloads counter by STI-FFLCH/USP and ABCD/USP (credited in the description). Validated against plugins.xsd.
d9d339f to
c192d64
Compare
|
Hi @edersotto, Thanks for the submission, and for carefully crediting. There are a few issues that would need to be fixed: plugins.xml metadata
~3.5.0.0 matches every 3.5.0.x. ~3.4.0.0 matches every 3.4.0.x.
Code — blocking
Could you please rework this to inject via the content hooks instead of replacing templates. As example, see https://github.com/pkp/pflPlugin/:
This solution keeps the plugin forward-compatible with 3.5.x releases. Code — minor
Suggested approach: a single per-submission cache (viewcounter-{submissionId}, 24h TTL). plugins/generic/pflPlugin caches its stats the same way (Cache::remember(...)). Fill it per-context:
Happy to re-review once the template handling is reworked and the plugins.xml metadata is adjusted. Thanks! |
…(3.5) and 1.1.1.0 (3.4)
…es; cache counts Addresses the plugin-gallery review (pkp/plugin-gallery#505): - No core template is replaced any more. The badge is appended through Templates::Issue::Issue::Article (summary lists) and Templates::Article::Main (article page); css/viewcounter.css + js/viewcounter.js move it next to the title when the default markup is present, otherwise it stays at the hook. - Counts are cached per submission for 24 h (Cache::remember). On issue TOC, journal home and search the cache is primed in bulk with one grouped query per metric type instead of one query per article. - Settings form no longer calls TemplateManager::clearTemplateCache(). - All labels come from locale keys; no hard-coded Portuguese. - {viewcounterStats} stays registered for themes that copied the old templates.
…es; cache counts Addresses the plugin-gallery review (pkp/plugin-gallery#505): - No core template is replaced any more. The badge is appended through Templates::Issue::Issue::Article (summary lists) and Templates::Article::Main (article page); css/viewcounter.css + js/viewcounter.js move it next to the title when the default markup is present, otherwise it stays at the hook. - Counts are cached per submission for 24 h (Cache::remember). On issue TOC, journal home and search the cache is primed in bulk with one grouped query per metric type instead of one query per article. - Settings form no longer calls TemplateManager::clearTemplateCache(). - All labels come from locale keys; no hard-coded Portuguese. - {viewcounterStats} stays registered for themes that copied the old templates.
|
Hi @bozana, thank you for the thorough review. Everything is addressed:
New releases: 1.3.0.0 (OJS 3.5) and 1.1.1.0 (OJS 3.4), both from the same code. Ready for re-review, thanks again! |
|
Hi @edersotto, great!
Would be good to fix:
Optional/cosmetic:
Thanks a lot! |
New plugin: View Counter
Adds a gallery entry for View Counter (
generic, productviewcounter).discreetly next to the title on the summary lists and on the article landing page;
configurable per journal. On OJS 3.5 the counts are computed via the statistics service
with safe fallbacks.
1.2.0.0→ OJS 3.5.0.0 / 3.5.0.11.1.0.0→ OJS 3.4.0.0–3.4.0.9Provenance / credit
The plugin was rewritten and is maintained by OJSBR, based on an original OJS 3.3
access/downloads counter by STI-FFLCH/USP and ABCD/USP. That origin is credited in
the entry description. We couldn't find an actively maintained upstream repository for the
original, and OJSBR now maintains it under GPL-3.0.
Notes
plugins.xmlvalidated againstplugins.xsd(xmllint --schema).<certification>was set — happy for the reviewers to assign the appropriate one.plugins.xml; glad to reorder if you prefer a specific spot.