Skip to content
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

[Enhancement] Speedup the Feed-Dashboards #13513

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _build/data/transport.core.system_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
$settings['feed_modx_news_enabled']= $xpdo->newObject('modSystemSetting');
$settings['feed_modx_news_enabled']->fromArray(array (
'key' => 'feed_modx_news_enabled',
'value' => '1',
'value' => '0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I rejected this change in previous PR :) Please change it back to enabled by default.

'xtype' => 'combo-boolean',
'namespace' => 'core',
'area' => 'system',
Expand All @@ -567,7 +567,7 @@
$settings['feed_modx_security_enabled']= $xpdo->newObject('modSystemSetting');
$settings['feed_modx_security_enabled']->fromArray(array (
'key' => 'feed_modx_security_enabled',
'value' => '1',
'value' => '0',
Copy link
Contributor

@lawrenz1337 lawrenz1337 Jul 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you still leave default value as 0. Your previous PR was closed because of this or am I misreading something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is me and git only slowly getting friends. Sorry. :-(
Actually I went back from "off/0" to "on/1", so the file is as was before I made changes. I reverted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I rejected this change in previous PR :) Please change it back to enabled by default.

'xtype' => 'combo-boolean',
'namespace' => 'core',
'area' => 'system',
Expand Down
16 changes: 8 additions & 8 deletions manager/controllers/default/dashboard/widget.modx-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ class modDashboardWidgetNewsFeed extends modDashboardWidgetInterface {
* @return string
*/
public function render() {
$url = $this->modx->getOption('feed_modx_news');
$feedHost = parse_url($url, PHP_URL_HOST);
if ($feedHost && function_exists('checkdnsrr') && !checkdnsrr($feedHost, 'A')) {
return '';
}
$this->modx->loadClass('xmlrss.modRSSParser','',false,true);
$this->rss = new modRSSParser($this->modx);

$o = array();
$url = $this->modx->getOption('feed_modx_news');
$newsEnabled = $this->modx->getOption('feed_modx_news_enabled',null,true);
if (!empty($url) && !empty($newsEnabled)) {
$feedHost = parse_url($url, PHP_URL_HOST);
if ($feedHost && function_exists('checkdnsrr') && !checkdnsrr($feedHost, 'A')) {
return '';
}
$this->modx->loadClass('xmlrss.modRSSParser','',false,true);
$this->rss = new modRSSParser($this->modx);

$rss = $this->rss->parse($url);
if (is_object($rss)) {
foreach (array_keys($rss->items) as $key) {
Expand Down
16 changes: 8 additions & 8 deletions manager/controllers/default/dashboard/widget.modx-security.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ class modDashboardWidgetSecurityFeed extends modDashboardWidgetInterface {
public $rss;

public function render() {
$url = $this->modx->getOption('feed_modx_security');
$feedHost = parse_url($url, PHP_URL_HOST);
if ($feedHost && function_exists('checkdnsrr') && !checkdnsrr($feedHost, 'A')) {
return '';
}
$this->modx->loadClass('xmlrss.modRSSParser','',false,true);
$this->rss = new modRSSParser($this->modx);

$o = array();
$url = $this->modx->getOption('feed_modx_security');
$newsEnabled = $this->modx->getOption('feed_modx_security_enabled',null,true);
if (!empty($url) && !empty($newsEnabled)) {
$feedHost = parse_url($url, PHP_URL_HOST);
if ($feedHost && function_exists('checkdnsrr') && !checkdnsrr($feedHost, 'A')) {
return '';
}
$this->modx->loadClass('xmlrss.modRSSParser','',false,true);
$this->rss = new modRSSParser($this->modx);

$rss = $this->rss->parse($url);
if (is_object($rss)) {
foreach (array_keys($rss->items) as $key) {
Expand Down