Skip to content
View in the app

A better way to browse. Learn more.

DoniaWeB

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
     

Request: please null [ Profile Frames ] addons for Codychat 3.6

Featured Replies

It makes perfect sense that it wouldn't work because 9.0 has completely different code for addons and how they work, besides this addon is quite heavy, and the main issue is not just one thing — it is heavy on multiple layers at the same time: database, network, DOM, and browser observers.

First of all, the addon loads the entire photo_frames table with:

SELECT photo_frames.* FROM photo_frames

That means every frame record for every user is fetched in one go, even if the page only needs a small subset of them. If the table grows, the payload grows too. There is no filtering by current visible users, no pagination, and no lazy loading. So from the start, the addon is already pulling more data than it really needs.

In the first PHP snippet, it also does:

SELECT user_id FROM boom_chat

and stores all of that into userDetails(), but from the shown JavaScript this data is not even meaningfully used. So that is extra database work, extra PHP memory usage, extra JSON size, and extra browser parsing for something that appears unnecessary.

The biggest performance problem is in the JavaScript logic. Two MutationObservers are attached:

  • one on #chat_right_data

  • one on #chat_logs_container

and both are configured with:

{
    attributes: true,
    childList: true,
    characterData: true
}

This is very broad. It means the observers react to a lot of changes, not only to newly added avatars. In a live chat, DOM mutations happen constantly. So the callback can fire again and again, even for tiny UI updates.

Inside each observer callback, the code does a full scan again:

document.querySelectorAll('.user_item_avatar')
document.querySelectorAll('.ch_logs .chat_avatar')

So every time something changes, it re-selects all matching elements in the container, not just the new one. On active chats or large user lists, this becomes expensive very quickly.

Then for each avatar, it parses the onclick attribute function string to extract the user id:

($nodes2.prop('onclick').toString()).split(',')[1]

This is also fragile and inefficient. Parsing function text repeatedly is not a clean or cheap way to identify users. If the markup changes slightly, the whole logic can break.

Another serious issue: after every mutation batch, the addon does this again:

$.post('addons/AA_photo_frame/system/api.php', { token: utk })

and refreshes frameData from the server.

So every DOM mutation may trigger:

  • scanning the DOM,

  • looping over all avatars,

  • appending images again,

  • and making a fresh AJAX request for the entire frame dataset.

That is a very costly pattern. In a busy chat, this can create a constant stream of repeated API requests for the same data. If many users are online, this becomes unnecessary server load very fast.

The DOM handling is also inefficient. The code appends frame images repeatedly:

$nodes3.append('<img class="over2 ul_fr_bg" ...>')
$(ch_node).append('<img class="over ch_fr_bg" ...>')

but there is no solid protection against duplicate inserts before appending in all cases. That means the same avatar may be processed multiple times and get re-modified over and over. Repeated DOM writes are expensive, especially when triggered by observers.

There is also a cache-busting CSS load using:

boomAddCss('addons/AA_photo_frame/files/frame.css?v=<?php echo time(); ?>');

Using time() means the CSS URL changes on every page load, so browser caching is effectively disabled. That forces the browser to fetch the stylesheet again every time, which is unnecessary and adds even more overhead.

CodyChat 10.1

CodyChat 10.1 A modern, powerful real-time chat platform built for performance and customization. This free edition delivers all the essential features of CodyChat 10.1 without the premium cost  fast, responsive, and fully modular for developers and community owners.

10.1.rar

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Latest Updated Files

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.