[DBTech] DragonByte Shop

[DBTech] DragonByte Shop [Paid] 7.2.3

No permission to buy (€12.45)
Is there an expected upper limit of items to be allowed in the store before we can expect a performance hit? I added a lot of items about a week ago and since then my forum has been loading slowly, been trying to nail down what the issue could be, since this was the only change I'm wondering if I added too many items. We have nearly a thousand items.
 
Is there an expected upper limit of items to be allowed in the store before we can expect a performance hit? I added a lot of items about a week ago and since then my forum has been loading slowly, been trying to nail down what the issue could be, since this was the only change I'm wondering if I added too many items. We have nearly a thousand items.
I have not received any reports about scalability issues that I can recall 🤔 If you can, enable debug mode for your user only (method depends on how you run XF, and there might be addons for it) and check the SQL queries for any slow queries.
 
I have not received any reports about scalability issues that I can recall 🤔 If you can, enable debug mode for your user only (method depends on how you run XF, and there might be addons for it) and check the SQL queries for any slow queries.
Thank you so much for your quick reply and helpful response. Your suggestion to use debug mode helped me confirm that the slowdown I'm seeing is almost certainly related to database queries. I was able to identify another addon that was likely contributing, but I found that that the xf_dbtech_shop_item table seems to be performing a "full table scan" (the log mentioned Type: ALL) on every page and on my forum is the slowest loading query. That seems to explain why the issue only appeared after I added nearly a thousand items to the shop. I wonder if theres a way that an index could be utilized for improvements on page load? Since the full scan causes a performance hit on my forum. Just spitballing.
 
Thank you so much for your quick reply and helpful response. Your suggestion to use debug mode helped me confirm that the slowdown I'm seeing is almost certainly related to database queries. I was able to identify another addon that was likely contributing, but I found that that the xf_dbtech_shop_item table seems to be performing a "full table scan" (the log mentioned Type: ALL) on every page and on my forum is the slowest loading query. That seems to explain why the issue only appeared after I added nearly a thousand items to the shop. I wonder if theres a way that an index could be utilized for improvements on page load? Since the full scan causes a performance hit on my forum. Just spitballing.
Can you show me a screenshot of the query in the debug view, including the full stack trace (in a separate screenshot if necessary)?

I have a suspicion of what might be the cause, but with the above info I'll be able to tell for certain :)
 
I have created (With the help of AI), a cool looking shop layout for grid mode. It can be viewed here: Shop

If you want the css for your shop, then here it is. Just drop it into your extra.less template. make sure that your shop is in grid mode through the style properties for the shop.

CSS:
/* ===========================
   DBTech Shop – Category grid view
   Scoped to shop pages only
   =========================== */

body[data-template="dbtech_shop_category_view"],
body[data-template="dbtech_shop_overview"],
body[data-template="dbtech_shop"]
{
    /* Grid container: spacing between cards */
    .itemList-grid
    {
        display: flex;
        flex-flow: row wrap;
        gap: 16px;
        margin: 12px 0 20px;
        justify-content: flex-start;
    }

    /* Card base */
    .itemList-item-grid.node
    {
        position: relative;
        display: flex;
        flex-direction: column;

        width: 262px;
        max-width: 100%;
        padding: 10px 10px 12px;

        border-radius: 14px;
        border: 1px solid rgba(15, 23, 42, 0.9);
        background:
            radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.35), transparent 55%),
            radial-gradient(circle at 100% 100%, rgba(250, 204, 21, 0.25), transparent 55%),
            linear-gradient(135deg, #020617, #020617);

        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.95),
            0 14px 30px rgba(15, 23, 42, 0.95);

        transition:
            transform 0.18s ease-out,
            box-shadow 0.18s ease-out,
            border-color 0.18s ease-out,
            background-position 0.18s ease-out;
        overflow: hidden;
    }

    .itemList-item-grid.node:hover
    {
        transform: translateY(-4px);
        border-color: rgba(34, 197, 94, 0.8);
        box-shadow:
            0 0 0 1px rgba(34, 197, 94, 0.6),
            0 20px 40px rgba(15, 23, 42, 0.95);
    }

    /* Top overlay for inline mod checkbox */
    .itemList-item-gridOverlayTop
    {
        top: 10px;
        right: 10px;
    }

    /* Icon / thumbnail area */
    .itemList-item-grid--icon
    {
        margin-bottom: 10px;
        border-radius: 10px;
        overflow: hidden;
        background: radial-gradient(circle at 50% 0%, rgba(148, 163, 184, 0.35), transparent 60%);
    }

    .itemList-item-grid--icon img,
    .itemList-item-grid--icon .avatar
    {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: inherit;
    }

    /* Title & tagline */
    .itemList-item-grid .node-main
    {
        margin-bottom: 8px;
    }

    .itemList-item-grid .node-title a[data-shortcut="node-description"]
    {
        font-size: @xf-fontSizeLarger;
        font-weight: 800;
        color: @xf-textColorEmphasized;
    }

    .itemList-item-grid .node-description
    {
        margin-top: 3px;
        font-size: @xf-fontSizeSmall;
        color: @xf-textColorMuted;
    }

    /* Meta row under title (owner, filters) */
    .itemList-item-grid .contentRow-minor--smaller
    {
        margin-top: 6px;
        font-size: @xf-fontSizeSmallest;
        color: @xf-textColorMuted;
    }

    /* Rating + price row */
    .itemList-item-grid--priceRatingInfo
    {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .itemList-item-grid--priceRatingInfo .rating
    {
        font-size: @xf-fontSizeSmall;
        opacity: .9;
    }

    .itemList-item-grid--priceRatingInfo .price .label
    {
        border-radius: 999px;
        padding: 3px 9px;
        font-size: @xf-fontSizeSmallest;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;

        background: linear-gradient(135deg, #22c55e, #a3e635, #facc15);
        color: #022c22;
        border: 1px solid rgba(248, 250, 252, 0.85);
        box-shadow:
            0 0 4px rgba(34, 197, 94, 0.75),
            0 0 10px rgba(250, 204, 21, 0.65);
    }

    /* Buy button row */
    .itemList-item-grid--buyButton
    {
        margin-bottom: 6px;
    }

    .itemList-item-grid--buyButton .button--cta
    {
        border-radius: 999px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .itemList-item-grid--buyButton .button--cta:not([disabled]):hover
    {
        box-shadow:
            0 0 8px rgba(34, 197, 94, 0.8),
            0 0 16px rgba(56, 189, 248, 0.6);
    }

    /* Stock & update info at the bottom */
    .itemList-item-grid--updateInfo
    {
        margin-top: auto; /* push to bottom */
        padding-top: 6px;
        border-top: 1px solid rgba(15, 23, 42, 0.7);
        font-size: @xf-fontSizeSmallest;
        color: @xf-textColorMuted;
    }

    .itemList-item-grid--updateInfo .pairs > dt
    {
        color: @xf-textColorMuted;
    }

    /* Highlight very low stock */
    .itemList-item-grid--updateInfo .pairs dd a
    {
        font-weight: 600;
    }
    .itemList-item-grid--updateInfo .pairs dd a[data-stock-low="1"]
    {
        color: #f97316;
    }
}
 
Is there a website I can visit to see this in action, or photos?

Also, how much branding is there?
DragonByte uses all of his own add-ons, so you can see it on his site.

The branding is just the one line in the footer, with a link that goes to DragonByte.
 
So where is the best place to test before buying?
I don't run a demo board at the moment because it's challenging to set one up in a secure way that properly functions as a demo of admin functions as well, sorry.

This is why I significantly reduced the cost of the "entry-level" license, so people can try it for not that much money :)
 
Received the security update from XF today, and put in a ticket as my site crashed.

It was determined that the Shop was causing this. Currently the shop is disabled on my site in order for the rest of the site to work.

Here is a bug thread I started before XF isolated the problem for me.

 
Received the security update from XF today, and put in a ticket as my site crashed.

It was determined that the Shop was causing this. Currently the shop is disabled on my site in order for the rest of the site to work.

Here is a bug thread I started before XF isolated the problem for me.

Will be discussed / answered @ my site :)
 
  • Like
Reactions: CTS
Just for full disclosure, and I’ve run out of time to post a more detailed update, but one of the fixes involves locking container objects so they cannot be set/unset during template rendering.

You’ll run into this fairly quickly with the Shop add-on due to the User::hasPermission extension which is called during template rendering and ends up at getDbtechShopPurchases which tries to set dbtechShop.items on the container.

In some cases different solutions may need to be found, or you may need to gate writes behind a check to see whether the container is locked or not.

Feel free to get in touch if you have any questions.
 
DragonByte Tech updated [DBTech] DragonByte Shop with a new update entry:

7.2.3

Update highlights​

This version fixes an issue that could cause the site to stop functioning after upgrading to XenForo 2.3.9 or newer.

Ideally, you should install this update prior to updating XenForo. If you have already updated and your site is inaccessible, you can download the update and extract the zip file, then upload the new files to your site.

Alternatively, you can disable DB Shop, then update XenForo, then update DB Shop.


Complete Change...​


Read the rest of this update entry...
 
Just for full disclosure, and I’ve run out of time to post a more detailed update, but one of the fixes involves locking container objects so they cannot be set/unset during template rendering.

You’ll run into this fairly quickly with the Shop add-on due to the User::hasPermission extension which is called during template rendering and ends up at getDbtechShopPurchases which tries to set dbtechShop.items on the container.

In some cases different solutions may need to be found, or you may need to gate writes behind a check to see whether the container is locked or not.

Feel free to get in touch if you have any questions.
Not entirely sure how I didn't hit the problem locally when testing after updating to 2.3.9, but I was able to diagnose it and move the item cache container system into the correct flow.

As a sidenote, it would be helpful if the Entity class could allow getting the raw $this->_values. Here's a small trait I ended up needing to write:
PHP:
trait CacheableTrait
{
    public function toCacheableArray(): array
    {
        return $this->_values;
    }
}

I'm storing the entity values into the data registry but JSON_ARRAY and LIST_COMMA values cause problems when instantiating the entity back again, if I don't store the already JSON-encoded value for these columns.

Hopefully that made some semblance of sense as it's nearly midnight and I've not had any caffeine at all today :P
 
I had no idea, sorry for keeping you busy.

BUT between Chris and DBT, this was the quickest and easiest resolve I had, and thank you both.

And yes, I am fully up-n-running again.
Follow-up: I had to apply a hotfix to v7.2.3 because the new caching method prevents item edits from actually being saved in the cache. Please re-download v7.2.3 and re-import it, and that should fix everything for good (hopefully!). Sorry about that.
 
  • Like
Reactions: CTS
Back
Top Bottom