Shariff Plugin for OJS 3.3

Hi,
I installed the Shariff plug-in into my plug-in library and made relevant settings in Website settings-Appearance-Shariff Plugin. I tried the publication page, footer and sidebar in position, and after activating the sidebar, in Appearance-Setup Shariff Block Plugin is checked, but I don’t see this plug-in activated on any page of the website. What is the problem?

BTY, My OJS version is OJS 3.3.0.7, the Shariff version I installed is shariff-3_4_0-1.tar.gz, and I also downloaded shariff-3_3_0-2 but it cannot be installed into my system.

Hi @jicai.he,

Thanks for sharing. This is an third-party developed plugin, so I might ask @ronste1, if they might comment?

-Roger
PKP Team

Hi @jicai.he ,

if you use the sidebar you also need to enable to Shariff Block Plugin (as for any other ssidebar block).

Best wishes,
Ronald

As for your second comment, do you see any related error messages in your PHP error log? We do have the plugin running for multiple OJS 3.3 instalaltions and don’t have any problems.

@ronste1
I checked the PHP error log, as follows:

2023/11/28 08:52:27 [error] 25135#0: *8475 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class ‘APP\i18n\AppLocale’ not found in /www/wwwroot/www.vaccineandhealth.com/plugins/generic/shariff/ShariffPlugin.inc.php:202
Stack trace:
#0 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/classes/plugins/HookRegistry.inc.php(107): ShariffPlugin->addShariffButtons()
#1 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/classes/template/PKPTemplateManager.inc.php(1518): HookRegistry::call()
#2 /www/wwwroot/www.vaccineandhealth.com/cache/t_compile/42362804174f266c598cdb32c3208fc745b92101^addd65021fadf964339ab08cd1aa93ba59b14e9c_0.app.frontendobjectsarticledet.php(605): PKPTemplateManager->smartyCallHook()
#3 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_656539cb99e1a5_10652629()
#4 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#5 /www/wwwr” while reading response header from upstream, client: 39.155.155.6, server: www.vaccineandhealth.com, request: “GET /index.php/test/article/view/1 HTTP/2.0”, upstream: “fastcgi://unix:/tmp/php-cgi-74.sock:”, host: “www.vaccineandhealth.com”, referrer: “https://www.vaccineandhealth.com/index.php/test/index
2023/11/28 08:52:33 [error] 25135#0: *8475 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class ‘APP\i18n\AppLocale’ not found in /www/wwwroot/www.vaccineandhealth.com/plugins/generic/shariff/ShariffPlugin.inc.php:202
Stack trace:
#0 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/classes/plugins/HookRegistry.inc.php(107): ShariffPlugin->addShariffButtons()
#1 /www/wwwroot/www.vaccineandhealth.com/lib/pkp/classes/template/PKPTemplateManager.inc.php(1518): HookRegistry::call()
#2 /www/wwwroot/www.vaccineandhealth.com/cache/t_compile/42362804174f266c598cdb32c3208fc745b92101^addd65021fadf964339ab08cd1aa93ba59b14e9c_0.ap

Can you tell where the problem lies based on this log?

Thx,
Best regards,
Jackie

Hi @jicai.he ,

the error “Error: Class ‘APP\i18n\AppLocale’ not found” refers to line 202 in ShariffPlugin.inc.php for OJS 3.4 ! See:

OJS 3.3 code does not contain references to this class. You are using the wrong branch or release package.

Do you mean I installed the wrong Shariff plugin package? But I tried to install sharkiff-3_3_0-2 but it couldn’t be installed.


what should I do?

Best,
Jackie

@jicai.he ,

what you show should work and it actually does work on my systems. Do you see related errors in the PHP log when you try to install the plugin as shown above?

Did you try to install it from the plugin gallery? Does it work?

@ronste1

But there is no entry for uploading attachments in the plugin gallery.

what should I do?

The Shariff plugin is available in the plugin gallery. You don’t need to upload anything.

@ronste1

The OJS version I am using is 3.3.0.7. I did not find the Shariff plugin in the plugin gallery. There is only one Addthis, but it has stopped serving.

@jicai.he ,

if the plugin is not in your plugin gallery there seems to be something wrong with your installation. The plugin definetly is in the gallery for OJS 3.3.

What about any errors when you try to upload the tar.gz? This should also work. Maybe both issues are related? I can only guess …

@ronste1

I guess there is something wrong with my system. Our backend engineer just installed the plug-in through the backend database, and now it can work normally.

However, I have a suggestion, which is whether the current plug-in display UI can be improved or provide another display solution, such as displaying icons side by side like Addthis. what do you think?

Best,
Jackie

Hi @jicai.he ,

the plugin is base on a third party toolbox that provides the buttons and the GDPR compliant mechanics. It would be too much effort for me to fiddle with this toolbox to include additional options.

But you can get close to something like icons by just playing around with css. If you include the following in your journal stylesheet:

li.shariff-button a span.share_text {
  display: none!important;
}

li.shariff-button {
  min-width: auto!important;
}

Best wishes,
Ronald

1 Like

Hi @ronste1 ,

I got it, that’s helpful to me.

Best,
Jackie