Skip to content

Copernicus Native OJS 3.5 Plugin - #509

Open
arissupriy wants to merge 1 commit into
pkp:mainfrom
arissupriy:main
Open

Copernicus Native OJS 3.5 Plugin#509
arissupriy wants to merge 1 commit into
pkp:mainfrom
arissupriy:main

Conversation

@arissupriy

Copy link
Copy Markdown

No description provided.

@bozana

bozana commented Aug 18, 2026

Copy link
Copy Markdown

Hi @arissupriy,

Before this can be merged, there's one blocking issue, plus a scope question and several documentation items worth resolving:

Blocking: hardcoded write to an external server
In CopernicusNativePlugin.php, the exportIssues action contains:

file_put_contents('/home/arissupriy/stai/ejournal.staialanwar.ac.id/httpdocs/sample_copernicus.xml', $xml);

Every export on any installation running this plugin attempts to write the full exported XML to this hardcoded absolute path. This can't ship in a gallery plugin regardless of intent. Can you please remove this line and explain how it ended up in the release?

Scope: this only works for bilingual EN/Indonesian journals
foreach (['en', 'id'] as $lang) — the plugin only ever emits English and Indonesian <languageVersion> blocks, regardless of what locales a journal actually has configured, with Indonesian silently falling back to English content when empty. Also, there is hard coded error text here: https://github.com/arissupriy/Copernicus-Native-OJS/blob/main/CopernicusNativePlugin.php#L287. Thus, this reads like it was built for one specific set of Indonesian journals rather than as a general Index Copernicus exporter. As shipped, it's not really useful to most journals in the gallery — either generalize locale handling to read the journal's actual configured locales, or scope the plugin explicitly (name/description) as bilingual EN/ID-only rather than presenting it as general-purpose.

Exception handling leaks server internals — and duplicates what core already does

} catch (\Throwable $e) {
    echo "Fatal Error: " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine();
    exit;
}

This echoes exception details plus full server file paths to the browser. OJS already has a global exception handler (PKPContainer.php) that logs full details via error_log() server-side and never leaks file/line to the client. Simplest fix: drop the try/catch and let it bubble to core's handler; if you want a custom error page, error_log($e->__toString()) then show a generic translated message — no exception internals in the response.

Output doesn't fully conform to the ICI import schema
Checked against this schema https://journals.indexcopernicus.com/ic-import.xsd:

  • <license type="CC BY-SA"> is hardcoded regardless of the article's/journal's actual license — should be derived from the real license (schema supports 7 types).
  • <unparsedContent> (references) needs 25–5000 characters per the schema; the plugin only checks for non-empty, so short citations will pass here but fail actual ICI import.
  • numberOfArticles could be emitted as "0" for an issue with no matching submissions, but the schema requires ≥1 when present.
  • <country> is emitted even when an author has no country set in OJS — but the schema's country type is a closed enum with no empty option, so this produces invalid XML. Omit the element when empty instead.

plugins.xml entry

  • <description> repeats the same "via the OJS API" claim as the README — no REST API exists in the code. This is the text shown in the gallery UI itself before install, so worth fixing here specifically. Also a better explanation who are the targeted users (only Indonesian?) would be good to have, because other journals will not be able to use this plugin.
  • <institution>Developed by Aris SUpriyanto</institution> isn't the right use of that field. For a maintainer with no institution, the gallery already has some examples for this — either <institution/> or <institution>Independent</institution> — rather than repeating the developer's name.
  • Small nit: stray extra blank line before </plugins> in the diff.
  • Once everything is updated and correct, the <certification type="reviewed"/> can be added (see other examples).

Happy to review it again, once the major points are updated/fixed.
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants