-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Performance 4 (plugins) #12228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance 4 (plugins) #12228
Changes from 39 commits
d020e05
f8d247c
bcd8841
e1288c3
fdd996c
dfc5b98
aac1916
90ffc54
a9d98bd
33ba088
5c7afbf
9a1a4b6
a8f2a36
a158cae
b3da6e9
58b8fbb
8f28982
776666b
7b70c06
af3e78b
f5fc398
ac4921a
6f79ff1
943f500
ac0ebb4
b9adbc5
42a5a54
9e8063e
492fb9e
475b880
7edf386
5e7202b
9581e65
d0d9261
bea9c0b
bf361ca
b7636dc
755c648
8afee4f
5f011db
76fe7a9
33d7bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ public function onInit($id = 'dynamic_recaptcha_1') | |
| { | ||
| $pubkey = $this->params->get('public_key', ''); | ||
|
|
||
| if ($pubkey == null || $pubkey == '') | ||
| if ($pubkey === null || $pubkey === '') | ||
|
||
| { | ||
| throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY')); | ||
| } | ||
|
|
@@ -117,13 +117,13 @@ public function onCheckAnswer($code = null) | |
| case '1.0': | ||
| $challenge = $input->get('recaptcha_challenge_field', '', 'string'); | ||
| $response = $input->get('recaptcha_response_field', '', 'string'); | ||
| $spam = ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0); | ||
| $spam = ($challenge === null || $challenge === '' || $response === null || $response === ''); | ||
|
||
| break; | ||
| case '2.0': | ||
| // Challenge Not needed in 2.0 but needed for getResponse call | ||
| $challenge = null; | ||
| $response = $input->get('g-recaptcha-response', '', 'string'); | ||
| $spam = ($response == null || strlen($response) == 0); | ||
| $spam = ($response === null || $response === ''); | ||
|
||
| break; | ||
| } | ||
|
|
||
|
|
@@ -268,7 +268,7 @@ private function _recaptcha_http_post($host, $path, $data, $port = 80) | |
|
|
||
| $response = ''; | ||
|
|
||
| if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) == false ) | ||
| if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) === false ) | ||
|
||
| { | ||
| die('Could not open socket'); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ class JReCaptcha | |
| */ | ||
| public function __construct($secret) | ||
| { | ||
| if ($secret == null || $secret === '') | ||
| if ($secret === null || $secret === '') | ||
| { | ||
| die("To use reCAPTCHA you must get an API key from <a href='" | ||
| . self::$_signupUrl . "'>" . self::$_signupUrl . "</a>"); | ||
|
|
@@ -110,7 +110,7 @@ private function _submitHTTPGet($path, $data) | |
| public function verifyResponse($remoteIp, $response) | ||
| { | ||
| // Discard empty solution submissions | ||
| if ($response == null || strlen($response) == 0) | ||
| if ($response === null || $response === '') | ||
| { | ||
| $recaptchaResponse = new JReCaptchaResponse(); | ||
| $recaptchaResponse->success = false; | ||
|
|
@@ -131,7 +131,7 @@ public function verifyResponse($remoteIp, $response) | |
| $answers = json_decode($getResponse, true); | ||
| $recaptchaResponse = new JReCaptchaResponse(); | ||
|
|
||
| if (trim($answers['success']) == true) | ||
| if (trim($answers['success'])) | ||
|
||
| { | ||
| $recaptchaResponse->success = true; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ protected function getContactId($created_by) | |
| $query->where('contact.published = 1'); | ||
| $query->where('contact.user_id = ' . (int) $created_by); | ||
|
|
||
| if (JLanguageMultilang::isEnabled() === true) | ||
| if (JLanguageMultilang::isEnabled()) | ||
|
||
| { | ||
| $query->where('(contact.language in ' | ||
| . '(' . $this->db->quote(JFactory::getLanguage()->getTag()) . ',' . $this->db->quote('*') . ') ' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,7 @@ public function onContentPrepare($context, &$row, &$params, $page = 0) | |
| $page = 0; | ||
| } | ||
|
|
||
| if ($params->get('intro_only') || $params->get('popup') || $full || $view !== 'article') | ||
| if ($full || $view !== 'article' || $params->get('intro_only') || $params->get('popup')) | ||
| { | ||
| $row->text = preg_replace($regex, '', $row->text); | ||
|
|
||
|
|
@@ -144,19 +144,13 @@ public function onContentPrepare($context, &$row, &$params, $page = 0) | |
| $hasToc = $this->params->get('multipage_toc', 1); | ||
|
|
||
| // Adds heading or title to <site> Title. | ||
| if ($title) | ||
| if ($title && $page && @$matches[$page - 1][2]) | ||
|
||
| { | ||
| if ($page) | ||
| { | ||
| if ($page && @$matches[$page - 1][2]) | ||
| { | ||
| $attrs = JUtility::parseAttributes($matches[$page - 1][1]); | ||
| $attrs = JUtility::parseAttributes($matches[$page - 1][1]); | ||
|
|
||
| if (@$attrs['title']) | ||
| { | ||
| $row->page_title = $attrs['title']; | ||
| } | ||
| } | ||
| if (@$attrs['title']) | ||
|
||
| { | ||
| $row->page_title = $attrs['title']; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) | |
| return false; | ||
| } | ||
|
|
||
| if (($context === 'com_content.article') && ($view === 'article') && $params->get('show_item_navigation')) | ||
| if (($context === 'com_content.article') && $view === 'article' && $params->get('show_item_navigation')) | ||
|
||
| { | ||
| $db = JFactory::getDbo(); | ||
| $user = JFactory::getUser(); | ||
|
|
@@ -217,8 +217,6 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) | |
| $row->paginationrelative = $this->params->get('relative', 0); | ||
| } | ||
| } | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,7 +267,6 @@ public function onDisplay( | |
| // Set the selected skin | ||
| $skin = 'lightgray'; | ||
| $side = $app->isClient('administrator') ? 'skin_admin' : 'skin'; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert this change |
||
| if ((int) $levelParams->get($side, 0) < count($skindirs)) | ||
| { | ||
| $skin = basename($skindirs[(int) $levelParams->get($side, 0)]); | ||
|
|
@@ -490,6 +489,7 @@ public function onDisplay( | |
| } | ||
| } | ||
|
|
||
|
|
||
|
||
| // Template | ||
| $templates = array(); | ||
|
|
||
|
|
@@ -760,7 +760,7 @@ private function tinyButtons($name, $excluded) | |
| // Set some vars | ||
| $name = 'button-' . $i . str_replace(' ', '', $button->get('text')); | ||
| $title = $button->get('text'); | ||
| $onclick = $button->get('onclick') ? $button->get('onclick') : null; | ||
| $onclick = $button->get('onclick') ?: null; | ||
| $options = $button->get('options'); | ||
| $icon = $button->get('name'); | ||
|
|
||
|
|
@@ -801,7 +801,7 @@ private function tinyButtons($name, $excluded) | |
| icon: \"" . $icon . "\", | ||
| onclick: function () {"; | ||
|
|
||
| if ($button->get('modal') || $href) | ||
| if ($href || $button->get('modal')) | ||
| { | ||
| $tempConstructor .= " | ||
| var modalOptions = { | ||
|
|
@@ -823,21 +823,21 @@ private function tinyButtons($name, $excluded) | |
| if ($onclick && ($button->get('modal') || $href)) | ||
| { | ||
| $tempConstructor .= "\r\n | ||
| " . $onclick . " | ||
| "; | ||
| " . $onclick . ' | ||
| '; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| $tempConstructor .= "\r\n | ||
| " . $onclick . " | ||
| "; | ||
| " . $onclick . ' | ||
| '; | ||
| } | ||
|
|
||
| $tempConstructor .= " | ||
| $tempConstructor .= ' | ||
| } | ||
| }); | ||
| })();"; | ||
| })();'; | ||
|
|
||
| // The array with the toolbar buttons | ||
| $btnsNames[] = $name . ' | '; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,13 +244,13 @@ public function onFinderChangeState($context, $pks, $value) | |
| protected function index(FinderIndexerResult $item, $format = 'html') | ||
| { | ||
| // Check if the extension is enabled. | ||
| if (JComponentHelper::isEnabled($this->extension) === false) | ||
| if (!JComponentHelper::isEnabled($this->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
| // Check if the extension that owns the category is also enabled. | ||
| if (JComponentHelper::isEnabled($item->extension) === false) | ||
| if (!JComponentHelper::isEnabled($item->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,7 +251,7 @@ public function onFinderChangeState($context, $pks, $value) | |
| protected function index(FinderIndexerResult $item, $format = 'html') | ||
| { | ||
| // Check if the extension is enabled | ||
| if (JComponentHelper::isEnabled($this->extension) === false) | ||
| if (!JComponentHelper::isEnabled($this->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,7 +246,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') | |
| $item->setLanguage(); | ||
|
|
||
| // Check if the extension is enabled. | ||
| if (JComponentHelper::isEnabled($this->extension) == false) | ||
| if (!JComponentHelper::isEnabled($this->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,7 +252,7 @@ public function onFinderChangeState($context, $pks, $value) | |
| protected function index(FinderIndexerResult $item, $format = 'html') | ||
| { | ||
| // Check if the extension is enabled. | ||
| if (JComponentHelper::isEnabled($this->extension) === false) | ||
| if (!JComponentHelper::isEnabled($this->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,7 +206,7 @@ public function onFinderChangeState($context, $pks, $value) | |
| protected function index(FinderIndexerResult $item, $format = 'html') | ||
| { | ||
| // Check if the extension is enabled | ||
| if (JComponentHelper::isEnabled($this->extension) === false) | ||
| if (!JComponentHelper::isEnabled($this->extension)) | ||
|
||
| { | ||
| return; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict?
$this->params->get('username', '') !== ''There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.. thanks