e107inc/e107

View on GitHub
e107_plugins/news/news.php

Summary

Maintainability
A
0 mins
Test Coverage
F
41%

Variable $tmp is undeclared (Did you mean $tp)
Open

                unset($author,$tmp);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'description' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('description',$news['news_meta_description']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 1200 but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('og:image:width', 1200);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (total) is bool|null but \news_front::getPaginationParms() takes int defined at /code/e107_plugins/news/news.php:1991
Open

        $parms = $this->getPaginationParms($news_total, NEWSLIST_LIMIT);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (id) is null but \e_render::setUniqueId() takes string defined at /code/e107_handlers/e_render_class.php:212
Open

                $ns->setUniqueId(null); // prevent other tablerenders from using this content.
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'noindex, follow' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'twitter:card' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('twitter:card', 'summary');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'summary' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('twitter:card', 'summary');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('twitter:image', $metaImg);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'article:modified_time' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('article:modified_time', date('c', $modifiedTime));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Invalid offset "news_title" of array type array{}
Open

                $itemName = e107::getParser()->toHTML($this->currentRow['news_title'],true, 'TITLE');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 3 (parm) is array{layout:'main',display:mixed}|array{scroll:mixed,layout:'main',display:mixed} but \e_menu::renderMenu() takes string defined at /code/e107_handlers/menu_class.php:631
Open

            return e107::getMenu()->renderMenu('forum','newforumposts_menu', $parms, true);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'twitter:description' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('twitter:description', $news['news_summary']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (options) is 'w=1200' but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
Open

                    $metaImg = $tp->thumbUrl($mimg,'w=1200',false,true) ;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('og:image',$metaImg);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('og:image',$metaImg);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 3 (subject) is ?string but \str_replace() takes array|string
Open

            $this->addDebug("Query",str_replace('#',MPREFIX, $query));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (news) is null but \news_front::setNewsFrontMeta() takes array defined at /code/e107_plugins/news/news.php:581
Open

            $this->setNewsFrontMeta(null,$this->action);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 3 (subject) is 255 but \str_replace() takes array|string
Open

        $this->nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Returning type null but render() is declared to return bool
Open

        return null;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'noindex, follow' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'summary_large_image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('twitter:card', 'summary_large_image');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared function \news_style()
Open

                $template = news_style($news, 'extend', $param);
Severity: Critical
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:description' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:description', $news['news_summary']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'twitter:card' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('twitter:card', 'summary_large_image');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'robots' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:type' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:type','article');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (override) is true but \e107::title() takes false|string defined at /code/e107_handlers/e107_class.php:2885
Open

                e107::title($news['news_meta_title'], true);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:image',$im);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                        e107::meta('og:image',$tp->thumbUrl($tmp[0],'w=500',false,true) );
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWSLIST_THUMB
Open

        $param['thumbnail'] =(defined("NEWSLIST_THUMB")) ? NEWSLIST_THUMB : "border:0px";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Suspicious array access to nullable ?array|?bool
Open

        $icon = ($row['category_icon']) ? "<img src='".e_IMAGE."icons/".$row['category_icon']."' alt='' />" : "";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 6 (year) is string but \mktime() takes int
Open

                $enddate = mktime(23, 59, 59, $month, $lastday, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Returning type null but renderNewForumPosts() is declared to return string
Open

        return null;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'noindex, follow' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'article:published_time' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('article:published_time', date('c', $news['news_datestamp']));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 6 (year) is string but \mktime() takes int
Open

                    $startdate = mktime(0, 0, 0, $month, $day, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Invalid offset "category_name" of array type array{}
Open

        $categoryName = e107::getParser()->toHTML($this->currentRow['category_name'],true, 'TITLE');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'noindex, follow' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'article:section' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('article:section', $news['category_name']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('article:modified_time', date('c', $modifiedTime));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (text) is ?'All'|?'News'|?string but \e_parse::toHTML() takes string defined at /code/e107_handlers/e_parse_class.php:1532
Open

            $NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'),$NEWSLISTTITLE);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 5 (day) is false|string but \mktime() takes int
Open

                    $startdate = mktime(0, 0, 0, $month, $day, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 4 (mon) is false|string but \mktime() takes int
Open

                    $startdate = mktime(0, 0, 0, $month, $day, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared method \e_db::db_getList
Open

        $newsAr = $sql -> db_getList();
Severity: Critical
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'robots' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 3 (row) is null but \e107::canonical() takes array defined at /code/e107_handlers/e107_class.php:4080
Open

                    e107::canonical('news', 'index', null, $options);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'robots' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', $news['news_meta_robots']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (options) is 'w=500' but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
Open

                        e107::meta('og:image',$tp->thumbUrl($tmp[0],'w=500',false,true) );
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWSLIST_ITEMLINK
Open

        $param['itemlink'] = (defined("NEWSLIST_ITEMLINK")) ? NEWSLIST_ITEMLINK : "";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWSLIST_CATICON
Open

        $param['caticon'] =  (defined("NEWSLIST_CATICON")) ? NEWSLIST_CATICON : defset('ICONSTYLE');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (text) is ?'All'|?'News'|?string but \e_parse::toHTML() takes string defined at /code/e107_handlers/e_parse_class.php:1532
Open

            $NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'), $template['caption']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Found a return statement with a value in the implementation of the magic method \news_front::__construct, expected void return type
Open

    function __construct()
Severity: Info
Found in e107_plugins/news/news.php by phan

Argument 1 (text) is null but \e_parse::toHTML() takes string defined at /code/e107_handlers/e_parse_class.php:1532
Open

        $categoryName = e107::getParser()->toHTML($this->currentRow['category_name'],true, 'TITLE');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWSLIST_CATLINK
Open

        $param['catlink']  = (defined("NEWSLIST_CATLINK")) ? NEWSLIST_CATLINK : "";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Invalid offset 1 of array type array{}
Open

        $this->setNewsFrontMeta($newsList[1], $this->action);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Assigning ?string to property but \news_front->caption is array|false|string
Open

            $this->caption = $caption;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (text) is null but \e_parse::toHTML() takes string defined at /code/e107_handlers/e_parse_class.php:1532
Open

                $itemName = e107::getParser()->toHTML($this->currentRow['news_title'],true, 'TITLE');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'robots' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:updated_time' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('og:updated_time', $modifiedTime);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is int but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('og:updated_time', $modifiedTime);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'keywords' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('keywords',$news['news_meta_keywords']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (Data) is null but \ecache::set() takes string defined at /code/e107_handlers/cache_handler.php:235
Open

        $e107cache->set($cache_tag, $cache_data);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared method \e_db::db_getList
Open

            $newsList = $sql->db_getList();
Severity: Critical
Found in e107_plugins/news/news.php by phan

Argument 4 (mon) is false|string but \mktime() takes int
Open

                    $startdate = mktime(0, 0, 0, $month, $day, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is 'article' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:type','article');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:image',"https://img.youtube.com/vi/".$img."/0.jpg");
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:image',"https://img.youtube.com/vi/".$img."/0.jpg");
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

            e107::meta('article:published_time', date('c', $news['news_datestamp']));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'article:tag' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('article:tag', trim($t));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                        e107::meta('og:image',$tp->thumbUrl($tmp[0],'w=500',false,true) );
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 6 (year) is string but \mktime() takes int
Open

                    $startdate = mktime(0, 0, 0, $month, $day, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared property \e_db->total_results
Open

        $news_total=$sql->total_results;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Invalid offset 1 of array type array{}
Open

                    $newsdata[$loop] .= $this->ix->render_newsitem($news, 'return', '', '', $param);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Returning type string|true but renderCache() is declared to return null
Open

        return $this->text;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (news) is null but \news_front::setNewsFrontMeta() takes array defined at /code/e107_plugins/news/news.php:581
Open

        $this->setNewsFrontMeta($newsList[1], $this->action);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWS_LAYOUT
Open

            $this->templateKey = NEWS_LAYOUT;
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:image:width' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('og:image:width', 1200);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'twitter:image' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('twitter:image', $metaImg);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 2 (content) is string but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                    e107::meta('article:tag', trim($t));
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 4 (width) is null but \comment::compose_comment() takes int defined at /code/e107_handlers/comment_class.php:1056
Open

            $text = e107::getComment()->compose_comment('news', 'comment', $news['news_id'], null, $news['news_title'], false, 'html');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 5 (day) is false|string but \mktime() takes int
Open

                $enddate = mktime(23, 59, 59, $month, $lastday, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Invalid offset 1 of array type array{}
Open

                    $newsdata[$loop] .= "<div class='{$ALTERNATECLASSES[0]}'>".$this->ix->render_newsitem($news, "return", '', '', $param)."</div>";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared method \e_db::db_getList
Open

            $newsAr = $sql -> db_getList();
Severity: Critical
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'robots' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('robots', 'noindex, follow');
Severity: Minor
Found in e107_plugins/news/news.php by phan

Variable $newsUrlparms was undeclared, but array fields are being added to it.
Open

                if(vartrue($newsAr[1]['category_sef'])) $newsUrlparms['name'] = $newsAr[1]['category_sef'];
Severity: Info
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'twitter:description' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('twitter:description',$news['news_meta_description']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 4 (mon) is false|string but \mktime() takes int
Open

                $enddate = mktime(23, 59, 59, $month, $lastday, $year);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared method \e_db::db_getList
Open

                    $newsAr = $sql -> db_getList();
Severity: Critical
Found in e107_plugins/news/news.php by phan

Variable $tmp is undeclared (Did you mean $tp)
Open

                unset($word,$tmp);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (name) is 'og:description' but \e107::meta() takes null defined at /code/e107_handlers/e107_class.php:2861
Open

                e107::meta('og:description',$news['news_meta_description']);
Severity: Minor
Found in e107_plugins/news/news.php by phan

Argument 1 (text) is ?'All'|?'News'|?string but \e_parse::toHTML() takes string defined at /code/e107_handlers/e_parse_class.php:1532
Open

            $NEWSLISTTITLE = LAN_NEWS_82." '".$tp->toHTML($category_name,FALSE,'TITLE')."'";
Severity: Minor
Found in e107_plugins/news/news.php by phan

Call to undeclared function \news_style()
Open

                    $template = news_style($news, $action, $param);
Severity: Critical
Found in e107_plugins/news/news.php by phan

Reference to undeclared constant \NEWS_NEXTPREV_NAVCOUNT
Open

            $opts['navcount'] = NEWS_NEXTPREV_NAVCOUNT;
Severity: Minor
Found in e107_plugins/news/news.php by phan

There are no issues that match your filters.

Category
Status