wmarkow / mybb-wordpress-theme

Embedds your MyBB forum into your Wordpress page. It provides the visual integration only.
2 stars 0 forks source link

When plugin is enabled the threads views counter is not updated. #19

Closed wmarkow closed 8 years ago

wmarkow commented 8 years ago

Threads view counter does not get increased when users read the thread. It works fine when mybb-wordpress-theme plugin is disabled so the plugin has some impact to MyBB main processing.

wmarkow commented 8 years ago

According to MyBB 1.8.6 source code, when there are some PHP errors handled during request processing then "run_shutdown" method (where shutdown queries are executed; thread's views counter as well) skips executing the shutdown queries. Further investigation shows that plugin generates some errors/warnings when loading HTML dom documents.

Here are some logs collected by MyBB engine:

<error>
    <dateline>1450822498</dateline>
    <script>inc/plugins/wordpress_theme.php</script>
    <line>118</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>DOMDocument::loadHTML(): Tag nav invalid in Entity, line: 132</message>
</error>

<error>
    <dateline>1450822498</dateline>
    <script>inc/plugins/wordpress_theme.php</script>
    <line>130</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>DOMDocument::loadHTML(): ID top already defined in Entity, line: 129</message>
</error>

<error>
    <dateline>1450822498</dateline>
    <script>inc/plugins/wordpress_theme.php</script>
    <line>130</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>DOMDocument::loadHTML(): ID pid82330 already defined in Entity, line: 349</message>
</error>

According to this and thisit looks like libxml library generates errors for not well formated html (wordpress page or mybb page).

wmarkow commented 8 years ago

Fixed.