This plugin doesn't seem to have huge adverse effects, however I do have quite a number of concerns.
My biggest concern is the following piece of code:
|
To explain the logic, it basically takes the text that the user enters for the first post, then sends it to the parser to convert bbCode into HTML. After the conversion, it will take this HTML and chop it at the maximum length specified.
To the observant reader, this methodology has a number of problems:
- HTML tags are considered in the length
- It's possible for this to chop off tags in the middle
For example, set the maximum length to 10, and make a new thread with the following post:
|
The above will generate a preview of "abc".
The placement of preg_replace is also susceptible to triple dots in posts, eg, even if we set a maximum of 200 chars, the following post will break previews:
|
Fixing the above correctly isn't terribly easy - it would require a HTML parser which properly counts length. Doing this may cause additional slowdown to the board, however this can actually be mitigated through a preparser.
Which brings to the next issue, the parser is called for every thread on forumdisplay, which can increase load a bit, considering that forumdisplay is usually an often visited page. Preparsing would solve this issue, although, arguably, MyBB itself doesn't include a post preparser.
I do like the use of caching first posts - something many plugin authors seem to forget to do.
Another concern I have is that template edits aren't performed during activation (FBI comments that he removed it) however it's still being done in deactivation. I guess it works, but it seems a bit odd.
Lastly, this does leave various tidbits from the MyBB 1.2.x era, such as:
|
The above code should be removed, and "rebuildsettings" should be replaced with "rebuild_settings"
|
|
...etc
From memory, yes/no was converted to 1/0 in MyBB 1.4 (need to double check that)
|
Should use $db->delete_query for those.
Otherwise, it seems to be a good effort from FBI, who claims to be not a PHP coder