CMSB v3.75 Released (Dec 10) - DB Performance & Debug Footers

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 28   (RSS)

Hi everyone,

Version 3.75 is now live! Here are the major new features: 

  • Enhanced Uploads Table Performance: We've implemented database optimization and added new indexes to the uploads table, resulting in performance improvements of 10x or greater. This improvement is particularly noticeable for large upload databases.
  • Web Debug Footer: A new debugging feature for administrators. When logged in as an admin, you can append __debug to any front-end page URL (after ? or &) to display debugging information and a list of included files in the footer. This is particularly useful when troubleshooting sites that use permalinks or multiple include files, as it helps determine which files need editing.
  • CMS Debug Footer for Plugin Developers: When logged in as an administrator, you can view the page source of any CMS page to find a comprehensive list of included PHP files and plugin hooks called on each file. This feature makes it much easier to determine where to "hook in" when developing plugins for the CMS.

New Features for Programmers

Below is the complete changelog:

*** December 10, 2024 - Version 3.75 (DB Performance and Debug Footers)

SERVER REQUIREMENTS (Since Dec 2023): PHP 8.0+ and MySQL 5.7+ (or MariaDB 10.2+)

NEW FEATURES
- Uploads Table: Optimized database and added indexes for faster performance (up to 10x faster for large databases)
- Debug Footers: Added admin debug footers (HTML comments with page/system info for troubleshooting)
- Frontend: Add ?__debug to URL to see exec time, memory usage, and included files
- CMS Admin: View source to see loaded menu files and plugin hooks available on any page

MINOR CHANGES
- Database Editor UI: Add colored labels for MySQL Type column and display non-utf8mb4 charsets (if present)
- Admin > General > Timezones: Current timezones are now highlighted in dropdown
- Upload fields: Columns now store a count of the uploads (for database queries)

BUG FIXES
- PHP 8.4 compatibility fixes
- Database Editor: Added option to bypass errors when unable to automatically apply schema updates
- Single Record Menus: Fixed issue where previous uploads weren't showing up in upload browse list
- Preview: Fixed issue where preview wouldn't open if record didn't contain a wysiwyg field
- Minor UI fixes for field and label spacing and alignment
- Misc code and other minor improvements

FOR PROGRAMMERS
- PHP Compatibility: Added backward-compatible polyfill functions for PHP 8.1–8.4, allowing usage regardless of the current PHP version
- New functions: Added utility functions: explodeTSV(), implodeTSV() and inTSV() for parsing multi-value list field values
- ZenDB: Results are returned as SmartArrays and SmartStrings for advanced array and string manipulation
- ZenDB: Added :: as an alternative alias for inserting table prefixes
- ZenDB: New $results->load('field') method loads records for uploads, createdByUserNum, and other list fields
FOR PROGRAMMERS: **BACKWARDS INCOMPATIBLE CHANGES**
- Note: This only applies to developers who have written custom PHP code using the following features:
- SmartArray: Values now remain as raw values by default (previously auto-converted to SmartStrings)
- To update code: Replace SmartArray::new() with SmartArray::newSS() to maintain previous behavior
- ZenDB: Some method names have been updated (old names still work but will be removed in a future release)
- Enable: Admin > Security > Developer Warnings, and monitor Developer Log for deprecation warnings (silently logged)

You can download the latest version here: https://www.interactivetools.com/download/

Please feel free to ask any questions or post any feedback, questions, or bugs you find! 

Thank you!

Dave Edis - Senior Developer
interactivetools.com

By rez - January 28 - edited: January 28

I'm, for example, fetching recipes that contain the product on a details web page. So in a recipe record, I have checkboxes / a list of all the products (list from another database table) I manually checkbox when pasting in a recipe (meh, works ok for a small site, kind of manual though). Then, on the product page, the related recipes are displayed, example below. Over the years, all the exploding and such to get this type of thing done has always put me in a fog and I'd use snippets to get it done again next time.

This is what load is for? As in, the header when making a list (loading records) gets this all done? Where do I learn more? Is this in the code generator now or... 

Thanks for any direction.

    <?php if($retail_itemsRecord):?>     
           <!-- Display recipes if they match the current product -->
        <?php
          $matchedRecipes = [];
          foreach ($recipesRecords as $recipe) {
              if (in_array($retail_itemsRecord['num'], $recipe['products:values'])) {
                  $matchedRecipes[] = $recipe;
              }
          }
        ?>

        <?php if (!empty($matchedRecipes)): ?>
          <section class="theme-1 padding-vertical-1">
            <div class="grid-container">
              <div class="grid-x grid-padding-x">              
                  <div class="cell">
                      <hr>
                      <h2>Related Recipes:</h2>
                  </div>
              </div>
            </div>
        </section>
    <?php endif ?>

    <?php if($retail_itemsRecord):?>
          <section class="theme-1 padding-vertical-1">
            <div class="grid-container">
              <div class="grid-x grid-padding-x medium-up-3 large-up-4" data-equalizer data-equalize-on="medium" data-equalize-by-row="true">
                
                  <?php foreach ($matchedRecipes as $recipe): ?>
                    <a href="<?php echo htmlencode($recipe['_link']); ?>">
                    <div class="cell padding-1">
                    <div class="card" data-equalizer-watch>
                      <?php if (!empty($recipe['image'])): ?>  
                          <?php foreach ($recipe['image'] as $index => $upload): ?>
                            <img src="<?php echo htmlencode($upload['thumbUrlPath3']) ?>" alt="<?php echo ($recipe['title']) ?>">
                          <?php endforeach ?>
                      <?php else: ?>
                        <?php foreach ($placeholder_imageRecord['image'] as $index => $upload): ?>    
                          <img src="<?php echo htmlencode($upload['thumbUrlPath3']) ?>" alt="<?php echo ($recipe['title']) ?>">
                        <?php endforeach; ?>
                      <?php endif; ?>
                      <div class="card-section">
                        <?php echo htmlencode($recipe['title']); ?>
                      </div>      
                    </div>
                    </div></a>
                  <?php endforeach; ?>
              </div>
            </div>
          </section>
        <?php endif; ?>
    <?php endif ?>