e107inc/e107

View on GitHub
e107_admin/plugin.php

Summary

Maintainability
A
40 mins
Test Coverage
F
10%

Consider simplifying this complex logical expression.
Open

                if(strpos($path,'_front.php')===false && strpos($path,'_admin.php')===false && strpos($path,'_global.php')===false && strpos($path,'_menu.php')===false && strpos($path,'_notify.php')===false && strpos($path,'_search.php')===false)
                {
                    return "<span class='text-error e-tip' title='File name should be either English_front.php, English_admin.php or English_global.php'>".$text."</span>";
                }
Severity: Major
Found in e107_admin/plugin.php - About 40 mins to fix

    Reference to undeclared property \plugin_ui->id (Did you mean expr->pid or $id)
    Open

                    $sql->update('plugin', "plugin_version ='{$eplug_version}', plugin_addons='{$eplug_addons}' WHERE plugin_id='$this->id' ");
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_INSTALLPLUGIN_ICON
    Open

                    $text .= "<a class='btn btn-default' href=\"" . e_SELF . "?mode=installed&action=install&path=".$var['plugin_path']."&e-token=".defset('e_TOKEN')."\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_UPGRADEPLUGIN_ICON
    Open

                $text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=upgrade&path=".$var['plugin_path']."&e-token=".defset('e_TOKEN')."' title=\"" . EPL_UPGRADE . " v" . $var['plugin_version_file'] . "\" >" . ADMIN_UPGRADEPLUGIN_ICON . "</a>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                    $name = deftrue($info['plugin_name'],$info['plugin_name']). " v".$eplug_version. "({e_PLUGIN}".$info['plugin_path'].")";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 2 (parseBB) is '' but \e_parse::toHTML() takes bool|false defined at /code/e107_handlers/e_parse_class.php:1532
    Open

                <legend>".EPL_ADLAN_54." ".$tp->toHTML($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable")."</legend>
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_INSTALLPLUGIN_ICON
    Open

            $dicon = '<a title="'.EPL_ADLAN_237.'" class="e-modal btn btn-default btn-secondary" href="'.$url.'" rel="external" data-loading="'.e_IMAGE.'/generic/loading_32.gif"  data-cache="false" data-modal-caption="'.$modalCaption.'"  target="_blank" >'.ADMIN_INSTALLPLUGIN_ICON.'</a>';
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_UNINSTALLPLUGIN_ICON
    Open

                    $text .= "<a class='btn btn-default' href=\"" . e_SELF . "?mode=".$mode."&action=uninstall&path=".$var['plugin_path']."&e-token=".defset('e_TOKEN')."\" title='" . EPL_ADLAN_1 . "'  >" . ADMIN_UNINSTALLPLUGIN_ICON . "</a>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 3 (selected) is 0 but \e_form::select() takes bool|false defined at /code/e107_handlers/form_handler.php:3325
    Open

                    $del_text = $frm->select('delete_files','yesno',0);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

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

                $v['id'] = $id;
    Severity: Info
    Found in e107_admin/plugin.php by phan

    Returning type array{caption:'Updates to be Installed',text:string} but renderHelp() is declared to return string
    Open

                return array('caption'=>EPL_ADLAN_247, 'text'=>$text);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

                'plugin_id'     => $data['plugin_id'],
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 2 (type) is 'plugin' but \e_file::gitPull() takes null defined at /code/e107_handlers/file_class.php:1591
    Open

                $return = e107::getFile()->gitPull($id, 'plugin');
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

                'plugin_mode'   => $data['plugin_mode'],
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 2 (parseBB) is '' but \e_parse::toHTML() takes bool|false defined at /code/e107_handlers/e_parse_class.php:1532
    Open

                $conf_title = !empty($var['plugin_admin_caption']) ? $var['plugin_admin_caption'] : LAN_CONFIGURE . ' ' . $tp->toHTML($var['plugin_name'], "", "defs,emotes_off, no_make_clickable");
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to undeclared method \e_object::loadBatch
    Open

                $this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, 0, false, $this->listQry))->loadBatch();
    Severity: Critical
    Found in e107_admin/plugin.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                    $func = $eplug_folder.'_upgrade';
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

                'plugin_url'    => $data['plugin_url'],
    Severity: Minor
    Found in e107_admin/plugin.php by phan

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

                $data[] = array(
    Severity: Info
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

                'plugin_folder' => $data['plugin_folder'],
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                $this->plugin = $path;
    Severity: Minor
    Found in e107_admin/plugin.php by phan

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

                    return null;
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to undeclared function _upgrade in callable
    Open

                        $text .= call_user_func($func);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 3 (selected) is 0|1 but \e_form::select() takes bool|false defined at /code/e107_handlers/form_handler.php:3325
    Open

                    $text .= "</td>\n<td>".$frm->select($key,$val['itemList'],$val['itemDefault']);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_CONFIGURE_ICON
    Open

                $plugin_config_icon = "<a class='btn btn-default' title='{$conf_title}' href='" . $var['plugin_admin_url'] . "' >" . ADMIN_CONFIGURE_ICON . "</a>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

            $modalCaption = (!empty($data['plugin_price'])) ? EPL_ADLAN_92." ".$data['plugin_name']." ".$data['plugin_version'] : EPL_ADLAN_230." ".$data['plugin_name']." ".$data['plugin_version'];
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_INSTALLPLUGIN_ICON
    Open

            $button = ADMIN_INSTALLPLUGIN_ICON;
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared constant \ADMIN_REPAIRPLUGIN_ICON
    Open

                $text .= "<a class='btn btn-default' href='" . e_SELF . "?mode=".$mode."&action=repair&path=".$var['plugin_path']."&e-token=".defset('e_TOKEN')."' title='" . LAN_REPAIR_PLUGIN_SETTINGS . "'> " . ADMIN_REPAIRPLUGIN_ICON . "</a>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to deprecated function \e107plugin::update_plugins_table() defined at /code/e107_handlers/plugin_class.php:1696
    Open

                    e107::getPlugin()->update_plugins_table('update');
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious array access to nullable ?array<string>|?array<string>|?array<string>|?mixed</string></string></string>
    Open

                'plugin_price'  => $data['plugin_price'],
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to undeclared method \e_admin_ui::getMarketplace
    Open

            $url = $this->getController()->getMarketplace()->getDownloadModal('plugin', $data);
    Severity: Critical
    Found in e107_admin/plugin.php by phan

    Call to deprecated function \e107plugin::getPluginRecord() defined at /code/e107_handlers/plugin_class.php:1965
    Open

                    $info = e107plugin::getPluginRecord($this->id);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \plugin_ui->id (Did you mean expr->pid or $id)
    Open

                    $info = e107plugin::getPluginRecord($this->id);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to deprecated function \getperms() defined at /code/class2.php:1322
    Open

    if(!getperms("Z"))
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                    $sql->update('plugin', "plugin_version ='{$eplug_version}', plugin_addons='{$eplug_addons}' WHERE plugin_id='$this->id' ");
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Call to deprecated function \e107plugin::update_plugins_table() defined at /code/e107_handlers/plugin_class.php:1696
    Open

                    e107::getPlugin()->update_plugins_table('update');
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->lanDefsRaw
    Open

                                $this->scriptDefsData[] = array('file'=>$path, 'line'=>$ln, 'lan'=>$lan, 'value'=>$this->lanDefsRaw[$lan]);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 2 (fmask) is null but \e_file::get_files() takes string defined at /code/e107_handlers/file_class.php:245
    Open

                $files = $fl->get_files(e_PLUGIN.$path.'/languages',null,null,3);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Argument 3 (omit) is null but \e_file::get_files() takes string defined at /code/e107_handlers/file_class.php:245
    Open

                $files = $fl->get_files(e_PLUGIN.$path.'/languages',null,null,3);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->used
    Open

                $this->used = array_intersect($this->lanDefs,$this->scriptDefs);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                    $text2 .= "<div class='alert alert-info alert-block'>LAN items in this list have been named incorrectly. They should include 'LAN' in their name. eg. LAN_".strtoupper($this->plugin)."_001</div>";
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                    'lan'        => array(0 => 'Unused by '.$this->plugin, 1=>'Used by '.$this->plugin, 2=>'Unsure'),
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                    return str_replace(e_PLUGIN.$this->plugin.'/','',$path);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->used
    Open

                $used =  $this->renderTable($this->used, 'used');
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                $this->addTitle(ADLAN_98.SEP.EPL_ADLAN_114.SEP.EPL_ADLAN_221.SEP.$this->plugin);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->lanDefsRaw
    Open

                        $this->lanDefsRaw[$d] = $values[$k];
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                    if(strpos($this->lanDefsData[$k]['file'],$this->plugin) === false || in_array($v,$this->excludeLans))
    Severity: Minor
    Found in e107_admin/plugin.php by phan

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

                        $retloc[$type][$d]= $values[$k];
    Severity: Info
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->used
    Open

                            $v['status'] = (in_array($v['lan'],$this->used)) ? 1 : 0;
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->plugin
    Open

                    $text = str_replace(e_PLUGIN.$this->plugin.'/languages/','',$path);
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    Reference to undeclared property \pluginLanguage->lanDefsRaw
    Open

                        <td ><small>".$this->lanDefsRaw[$v['lan']]."</small></td>
    Severity: Minor
    Found in e107_admin/plugin.php by phan

    There are no issues that match your filters.

    Category
    Status