JezK
Edit File: IntegrationHooks.php
<?php namespace GeminiLabs\SiteReviews\Integrations; use GeminiLabs\SiteReviews\Hooks\AbstractHooks; use GeminiLabs\SiteReviews\Modules\Notice; abstract class IntegrationHooks extends AbstractHooks { protected function isEnabled(): bool { return true; } protected function isInstalled(): bool { return true; } protected function isVersionSupported(): bool { $supportedVersion = sanitize_text_field($this->supportedVersion()); if (empty($supportedVersion)) { return true; } $version = sanitize_text_field($this->version()); return version_compare($version, $supportedVersion, '>='); } /** * Integrations are hooked on "plugins_loaded" (before "init") so the notice * cannot be translated here. */ protected function notify(string $name): void { $supportedVersion = sanitize_text_field($this->supportedVersion()); $addWarning = function () use ($name, $supportedVersion) { /* translators: %1$s: plugin name, %2$s: plugin version */ $notice = _x('Update %1$s to version %2$s or higher to enable the integration with Site Reviews.', 'admin-text', 'site-reviews'); glsr(Notice::class)->addWarning(sprintf($notice, $name, $supportedVersion)); }; if (did_action('init')) { $addWarning(); return; } add_action('init', $addWarning); } protected function supportedVersion(): string { return ''; } protected function version(): string { return ''; } }