Code Duplication    Length = 6-8 lines in 2 locations

install/cli-install.php 2 locations

@@ 1274-1279 (lines=6) @@
1271
                    while ($row = mysqli_fetch_assoc($rs)) {
1272
                        $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1273
                        if ($row['description'] == $desc) {
1274
                            if (!mysqli_query($sqlParser->conn,
1275
                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
1276
                                echo mysqli_error($sqlParser->conn) . PHP_EOL;
1277
1278
                                return;
1279
                            }
1280
                            $insert = false;
1281
                        } else {
1282
                            if (!mysqli_query($sqlParser->conn,
@@ 1281-1288 (lines=8) @@
1278
                                return;
1279
                            }
1280
                            $insert = false;
1281
                        } else {
1282
                            if (!mysqli_query($sqlParser->conn,
1283
                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) {
1284
                                echo mysqli_error($sqlParser->conn) . PHP_EOL;
1285
1286
                                return;
1287
                            }
1288
                        }
1289
                    }
1290
                    if ($insert === true) {
1291
                        if(!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$props','$guid','0',$category);")) {