Skip to content

Commit

Permalink
Weaken plugin's message
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Aug 7, 2016
1 parent df3bb64 commit b07454a
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 32 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_admin/script.php
Expand Up @@ -346,7 +346,7 @@ protected function updateManifestCaches()
array('plugin', 'packageinstaller', 'installer', 0),
array('plugin', 'folderinstaller', 'installer', 0),
array('plugin', 'urlinstaller', 'installer', 0),
array('plugin', 'phpversioncheck', 'system', 0),
array('plugin', 'phpversioncheck', 'quickicon', 0),

// Templates
array('template', 'beez3', '', 0),
Expand Down
@@ -1,2 +1,2 @@
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
@@ -1,2 +1,2 @@
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
@@ -1,6 +1,6 @@
SET IDENTITY_INSERT #__extensions ON;

INSERT INTO #__extensions ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;
SELECT 458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

SET IDENTITY_INSERT #__extensions OFF;
@@ -0,0 +1,11 @@
; Joomla! Project
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_QUICKICON_PHPVERSIONCHECK="Quick Icon - PHP Version Check"
; Key 1 is the server's current PHP version, key 2 is the date at which support will end for the current PHP version
PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time from the PHP project. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Joomla will be faster and more secure if you upgrade to a newer PHP version (PHP 7.x is recommended). Please contact your host for upgrade instructions."
; Key 1 is the server's current PHP version, key 2 is the recommended PHP version, and key 3 is the date at which support will end for the recommended PHP version
PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED="We have detected that your server is using PHP %1$s which is obsolete and no longer receives official security updates by its developers. The Joomla project recommends upgrading your site to PHP %2$s or later which will receive security updates at least until %3$s. Please ask your host to make PHP %2$s or a later version the default version for your site. If your host is already PHP %2$s ready please enable PHP %2$s on your site's root and 'administrator' directories – typically you can do this yourself through a tool in your hosting control panel, but it's best to ask your host if you are unsure."
PLG_QUICKICON_PHPVERSIONCHECK_XML_DESCRIPTION="Checks the support status of your installation's PHP version and raises a warning if not fully supported."
Expand Up @@ -3,5 +3,5 @@
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_PHPVERSIONCHECK="System - PHP Version Check"
PLG_SYSTEM_PHPVERSIONCHECK_XML_DESCRIPTION="Checks the support status of your installation's PHP version and raises a warning if not fully supported."
PLG_QUICKICON_PHPVERSIONCHECK="Quick Icon - PHP Version Check"
PLG_QUICKICON_PHPVERSIONCHECK_XML_DESCRIPTION="Checks the support status of your installation's PHP version and raises a warning if not fully supported."
11 changes: 0 additions & 11 deletions administrator/language/en-GB/en-GB.plg_system_phpversioncheck.ini

This file was deleted.

4 changes: 2 additions & 2 deletions administrator/language/en-GB/install.xml
Expand Up @@ -173,6 +173,8 @@
<filename>en-GB.plg_quickicon_extensionupdate.sys.ini</filename>
<filename>en-GB.plg_quickicon_joomlaupdate.ini</filename>
<filename>en-GB.plg_quickicon_joomlaupdate.sys.ini</filename>
<filename>en-GB.plg_quickicon_phpversioncheck.ini</filename>
<filename>en-GB.plg_quickicon_phpversioncheck.sys.ini</filename>
<filename>en-GB.plg_search_categories.ini</filename>
<filename>en-GB.plg_search_categories.sys.ini</filename>
<filename>en-GB.plg_search_contacts.ini</filename>
Expand Down Expand Up @@ -201,8 +203,6 @@
<filename>en-GB.plg_system_logout.sys.ini</filename>
<filename>en-GB.plg_system_p3p.ini</filename>
<filename>en-GB.plg_system_p3p.sys.ini</filename>
<filename>en-GB.plg_system_phpversioncheck.ini</filename>
<filename>en-GB.plg_system_phpversioncheck.sys.ini</filename>
<filename>en-GB.plg_system_redirect.ini</filename>
<filename>en-GB.plg_system_redirect.sys.ini</filename>
<filename>en-GB.plg_system_remember.ini</filename>
Expand Down
2 changes: 1 addition & 1 deletion installation/sql/mysql/joomla.sql
Expand Up @@ -614,7 +614,7 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`
(455, 'plg_installer_packageinstaller', 'plugin', 'packageinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 1, 0),
(456, 'plg_installer_folderinstaller', 'plugin', 'folderinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 2, 0),
(457, 'plg_installer_urlinstaller', 'plugin', 'urlinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 3, 0),
(458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(503, 'beez3', 'template', 'beez3', '', 0, 1, 1, 0, '', '{"wrapperSmall":"53","wrapperLarge":"72","sitetitle":"","sitedescription":"","navposition":"center","templatecolor":"nature"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(504, 'hathor', 'template', 'hathor', '', 1, 1, 1, 0, '', '{"showSiteName":"0","colourChoice":"0","boldText":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(506, 'protostar', 'template', 'protostar', '', 0, 1, 1, 0, '', '{"templateColor":"","logoFile":"","googleFont":"1","googleFontName":"Open+Sans","fluidContainer":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion installation/sql/postgresql/joomla.sql
Expand Up @@ -614,7 +614,7 @@ INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder"
(455, 'plg_installer_packageinstaller', 'plugin', 'packageinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 1, 0),
(456, 'plg_installer_folderinstaller', 'plugin', 'folderinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 2, 0),
(457, 'plg_installer_urlinstaller', 'plugin', 'urlinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 3, 0),
(458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);

-- Templates
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
Expand Down
2 changes: 1 addition & 1 deletion installation/sql/sqlazure/joomla.sql
Expand Up @@ -1009,7 +1009,7 @@ SELECT 456, 'plg_installer_folderinstaller', 'plugin', 'folderinstaller', 'insta
UNION ALL
SELECT 457, 'plg_installer_urlinstaller', 'plugin', 'urlinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 3, 0
UNION ALL
SELECT 458, 'plg_system_phpversioncheck', 'plugin', 'phpversioncheck', 'system', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;
SELECT 458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 503, 'beez3', 'template', 'beez3', '', 0, 1, 1, 0, '', '{"wrapperSmall":"53","wrapperLarge":"72","sitetitle":"","sitedescription":"","navposition":"center","templatecolor":"nature"}', '', '', 0, '1900-01-01 00:00:00', 0, 0
Expand Down
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage System.phpversioncheck
* @subpackage Quickicon.phpversioncheck
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
Expand All @@ -14,7 +14,7 @@
*
* @since __DEPLOY_VERSION__
*/
class PlgSystemPhpVersionCheck extends JPlugin
class PlgQuickiconPhpVersionCheck extends JPlugin
{
/**
* Constant representing the active PHP version being fully supported
Expand Down Expand Up @@ -59,11 +59,13 @@ class PlgSystemPhpVersionCheck extends JPlugin
/**
* Check the PHP version after the admin component has been dispatched.
*
* @param string $context The calling context
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function onAfterDispatch()
public function onGetIcons($context)
{
if (!$this->displayMessage())
{
Expand Down Expand Up @@ -162,7 +164,7 @@ private function getPhpSupport()

$supportStatus['status'] = self::PHP_UNSUPPORTED;
$supportStatus['message'] = JText::sprintf(
'PLG_SYSTEM_PHPVERSIONCHECK_UNSUPPORTED',
'PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED',
PHP_VERSION,
$recommendedVersion,
$recommendedVersionEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
Expand All @@ -176,7 +178,7 @@ private function getPhpSupport()
{
$supportStatus['status'] = self::PHP_SECURITY_ONLY;
$supportStatus['message'] = JText::sprintf(
'PLG_SYSTEM_PHPVERSIONCHECK_SECURITY_ONLY', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
'PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
);
}
}
Expand Down Expand Up @@ -217,6 +219,12 @@ private function displayMessage()
return false;
}

// Only to com_cpanel
if ($this->app->input->get('option') == 'com_cpanel')
{
return false;
}

return true;
}
}
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.7" type="plugin" group="system" method="upgrade">
<name>plg_system_phpversioncheck</name>
<extension version="3.7" type="plugin" group="quickicon" method="upgrade">
<name>plg_quickicon_phpversioncheck</name>
<author>Joomla! Project</author>
<creationDate>August 2016</creationDate>
<copyright>Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.7.0</version>
<description>PLG_SYSTEM_PHPVERSIONCHECK_XML_DESCRIPTION</description>
<description>PLG_QUICKICON_PHPVERSIONCHECK_XML_DESCRIPTION</description>
<files>
<filename plugin="phpversioncheck">phpversioncheck.php</filename>
</files>
<languages>
<language tag="en-GB">en-GB.plg_system_phpversioncheck.ini</language>
<language tag="en-GB">en-GB.plg_system_phpversioncheck.sys.ini</language>
<language tag="en-GB">en-GB.plg_quickicon_phpversioncheck.ini</language>
<language tag="en-GB">en-GB.plg_quickicon_phpversioncheck.sys.ini</language>
</languages>
</extension>

0 comments on commit b07454a

Please sign in to comment.