Plugin Directory

Changeset 3459918


Ignore:
Timestamp:
02/12/2026 12:17:17 PM (7 weeks ago)
Author:
supportfromrichard
Message:

Version 1.4.1 - Remove debug logging that caused errors on live sites, update Pro links

Location:
sfr-book-review-showcase/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sfr-book-review-showcase/trunk/public/class-sfrbrs-public.php

    r3443078 r3459918  
    119119        }
    120120       
    121         // #region agent log
    122         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    123         $log_data = array(
    124             'location' => 'register_blocks',
    125             'message' => 'Free plugin registering blocks',
    126             'data' => array(
    127                 'has_register_block_type' => function_exists('register_block_type'),
    128                 'plugin_version' => SFRBRS_VERSION,
    129                 'block_dir' => SFRBRS_PLUGIN_DIR . 'blocks/reviews/',
    130                 'block_url' => SFRBRS_PLUGIN_URL . 'blocks/reviews/',
    131             ),
    132             'timestamp' => time() * 1000,
    133             'sessionId' => 'debug-session',
    134             'runId' => 'run1',
    135             'hypothesisId' => 'REG'
    136         );
    137         file_put_contents($log_file, json_encode($log_data) . "\n", FILE_APPEND);
    138         // #endregion
    139        
    140121        if ( ! function_exists( 'register_block_type' ) ) {
    141122            return;
     
    161142        );
    162143       
    163         // #region agent log
    164         $log_data2 = array(
    165             'location' => 'register_blocks',
    166             'message' => 'Script registered, about to register block',
    167             'data' => array(
    168                 'script_handle' => 'sfrbrs-review-block-editor',
    169                 'script_url' => $block_url . 'editor.js',
    170             ),
    171             'timestamp' => time() * 1000,
    172             'sessionId' => 'debug-session',
    173             'runId' => 'run1',
    174             'hypothesisId' => 'REG'
    175         );
    176         file_put_contents($log_file, json_encode($log_data2) . "\n", FILE_APPEND);
    177         // #endregion
    178 
    179144        // Localize script with book titles and categories for dropdowns
    180145        $all_books = $this->book_repository->get_all_simple();
     
    223188        );
    224189       
    225         // #region agent log
    226         $log_data3 = array(
    227             'location' => 'register_blocks',
    228             'message' => 'Block registration result',
    229             'data' => array(
    230                 'block_registered' => $result !== false,
    231                 'block_name' => $result ? $result->name : 'FAILED',
    232             ),
    233             'timestamp' => time() * 1000,
    234             'sessionId' => 'debug-session',
    235             'runId' => 'run1',
    236             'hypothesisId' => 'REG'
    237         );
    238         file_put_contents($log_file, json_encode($log_data3) . "\n", FILE_APPEND);
    239         // #endregion
    240190    }
    241191
     
    302252        $settings_attr = wp_json_encode( $data_settings );
    303253
    304         // #region agent log
    305         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    306         $log_render = array(
    307             'location' => 'render_reviews_shortcode',
    308             'message' => 'Rendering shortcode',
    309             'data' => array(
    310                 'style_attr' => $style_attr,
    311                 'classes' => implode( ' ', $classes ),
    312                 'layout' => isset($atts['layout']) ? $atts['layout'] : 'NOT SET',
    313                 'has_cards' => !empty($context['items']),
    314                 'cards_count' => count($context['items'])
    315             ),
    316             'timestamp' => time() * 1000,
    317             'sessionId' => 'debug-session',
    318             'runId' => 'run1',
    319             'hypothesisId' => 'M'
    320         );
    321         file_put_contents($log_file, json_encode($log_render) . "\n", FILE_APPEND);
    322         // #endregion
    323 
    324254        ob_start();
    325255        ?>
     
    355285        }
    356286       
    357         // #region agent log
    358         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    359         $log_data = array(
    360             'location' => 'render_reviews_block',
    361             'message' => 'Block render called',
    362             'data' => array(
    363                 'cardBackground' => isset($attributes['cardBackground']) ? $attributes['cardBackground'] : 'NOT SET',
    364                 'cardTextColor' => isset($attributes['cardTextColor']) ? $attributes['cardTextColor'] : 'NOT SET',
    365                 'accentColor' => isset($attributes['accentColor']) ? $attributes['accentColor'] : 'NOT SET',
    366                 'titleFontSize' => isset($attributes['titleFontSize']) ? $attributes['titleFontSize'] : 'NOT SET',
    367                 'bodyFontSize' => isset($attributes['bodyFontSize']) ? $attributes['bodyFontSize'] : 'NOT SET',
    368                 'reviewTextFontSize' => isset($attributes['reviewTextFontSize']) ? $attributes['reviewTextFontSize'] : 'NOT SET',
    369                 'shadow' => isset($attributes['shadow']) ? ($attributes['shadow'] ? 'true' : 'false') : 'NOT SET',
    370                 'shadow_type' => isset($attributes['shadow']) ? gettype($attributes['shadow']) : 'NOT SET',
    371                 'all_attributes' => $attributes
    372             ),
    373             'timestamp' => time() * 1000,
    374             'sessionId' => 'debug-session',
    375             'runId' => 'run1',
    376             'hypothesisId' => 'A'
    377         );
    378         file_put_contents($log_file, json_encode($log_data) . "\n", FILE_APPEND);
    379         // #endregion
    380 
    381287        return $this->render_reviews_shortcode( $attributes, '', 'sfr_book_reviews' );
    382288    }
     
    524430        $accent = isset( $atts['accentColor'] ) ? trim( $atts['accentColor'] ) : '#2563eb';
    525431       
    526         // #region agent log
    527         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    528         $log_data = array(
    529             'location' => 'normalise_attributes',
    530             'message' => 'Before color sanitization',
    531             'data' => array(
    532                 'raw_cardBackground' => $card_bg,
    533                 'raw_cardTextColor' => $card_text,
    534                 'raw_accentColor' => $accent
    535             ),
    536             'timestamp' => time() * 1000,
    537             'sessionId' => 'debug-session',
    538             'runId' => 'run1',
    539             'hypothesisId' => 'D'
    540         );
    541         file_put_contents($log_file, json_encode($log_data) . "\n", FILE_APPEND);
    542         // #endregion
    543        
    544432        // Check if colors are CSS variables (from old theme color selections) - convert to defaults
    545433        if ( ! empty( $card_bg ) && ( strpos( $card_bg, 'var(' ) === 0 || strpos( $card_bg, '--' ) === 0 ) ) {
     
    569457        $atts['accentColor']    = sanitize_hex_color( $accent ) ?: '#2563eb';
    570458       
    571         // #region agent log
    572         $log_data2 = array(
    573             'location' => 'normalise_attributes',
    574             'message' => 'After color sanitization',
    575             'data' => array(
    576                 'final_cardBackground' => $atts['cardBackground'],
    577                 'final_cardTextColor' => $atts['cardTextColor'],
    578                 'final_accentColor' => $atts['accentColor']
    579             ),
    580             'timestamp' => time() * 1000,
    581             'sessionId' => 'debug-session',
    582             'runId' => 'run1',
    583             'hypothesisId' => 'E'
    584         );
    585         file_put_contents($log_file, json_encode($log_data2) . "\n", FILE_APPEND);
    586         // #endregion
    587 
    588459        $shadow_flag    = filter_var( $atts['shadow'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE );
    589460        $atts['shadow'] = ( null === $shadow_flag ) ? true : (bool) $shadow_flag;
     
    755626        );
    756627
    757         // #region agent log
    758         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    759         $log_data = array(
    760             'location' => 'build_style_attribute',
    761             'message' => 'Building style attribute',
    762             'data' => array(
    763                 'input_cardBackground' => isset($atts['cardBackground']) ? $atts['cardBackground'] : 'NOT SET',
    764                 'input_cardTextColor' => isset($atts['cardTextColor']) ? $atts['cardTextColor'] : 'NOT SET',
    765                 'input_titleFontSize' => isset($atts['titleFontSize']) ? $atts['titleFontSize'] : 'NOT SET',
    766                 'input_bodyFontSize' => isset($atts['bodyFontSize']) ? $atts['bodyFontSize'] : 'NOT SET',
    767                 'input_reviewTextFontSize' => isset($atts['reviewTextFontSize']) ? $atts['reviewTextFontSize'] : 'NOT SET',
    768                 'normalized_cardBackground' => $card_bg,
    769                 'normalized_cardTextColor' => $card_text,
    770                 'title_font_size_var' => isset($style_vars['--sfrbrs-title-font-size']) ? $style_vars['--sfrbrs-title-font-size'] : 'NOT SET',
    771                 'body_font_size_var' => isset($style_vars['--sfrbrs-body-font-size']) ? $style_vars['--sfrbrs-body-font-size'] : 'NOT SET',
    772                 'review_text_font_size_var' => isset($style_vars['--sfrbrs-review-text-font-size']) ? $style_vars['--sfrbrs-review-text-font-size'] : 'NOT SET',
    773                 'style_vars' => $style_vars
    774             ),
    775             'timestamp' => time() * 1000,
    776             'sessionId' => 'debug-session',
    777             'runId' => 'run1',
    778             'hypothesisId' => 'B'
    779         );
    780         file_put_contents($log_file, json_encode($log_data) . "\n", FILE_APPEND);
    781         // #endregion
    782 
    783628        $style_attr = '';
    784629        foreach ( $style_vars as $var => $value ) {
     
    788633        }
    789634
    790         // #region agent log
    791         $log_data2 = array(
    792             'location' => 'build_style_attribute',
    793             'message' => 'Style attribute built',
    794             'data' => array(
    795                 'final_style_attr' => $style_attr,
    796                 'card_bg_value' => $card_bg,
    797                 'card_text_value' => $card_text,
    798                 'accent_value' => $accent_color,
    799                 'layout' => isset($atts['layout']) ? $atts['layout'] : 'NOT SET',
    800                 'gap' => isset($atts['gap']) ? $atts['gap'] : 'NOT SET',
    801                 'card_bg_in_style' => strpos($style_attr, '--sfrbrs-card-bg') !== false,
    802                 'card_text_in_style' => strpos($style_attr, '--sfrbrs-card-text') !== false,
    803                 'accent_in_style' => strpos($style_attr, '--sfrbrs-accent') !== false
    804             ),
    805             'timestamp' => time() * 1000,
    806             'sessionId' => 'debug-session',
    807             'runId' => 'run1',
    808             'hypothesisId' => 'C'
    809         );
    810         file_put_contents($log_file, json_encode($log_data2) . "\n", FILE_APPEND);
    811         // #endregion
    812 
    813635        return $style_attr;
    814636    }
     
    816638    private function build_container_classes( $atts ) {
    817639        $classes = array( 'sfrbrs-reviews', 'sfrbrs-layout-' . $atts['layout'] );
    818 
    819         // #region agent log
    820         $log_file = '/Users/richard/Local Sites/htmlvsitemap/.cursor/debug.log';
    821         $log_shadow = array(
    822             'location' => 'build_container_classes',
    823             'message' => 'Building container classes',
    824             'data' => array(
    825                 'shadow_value' => isset($atts['shadow']) ? $atts['shadow'] : 'NOT SET',
    826                 'shadow_type' => isset($atts['shadow']) ? gettype($atts['shadow']) : 'NOT SET',
    827                 'shadow_bool' => isset($atts['shadow']) ? (bool)$atts['shadow'] : 'NOT SET',
    828                 'will_add_shadow_class' => isset($atts['shadow']) && $atts['shadow'] ? 'YES' : 'NO'
    829             ),
    830             'timestamp' => time() * 1000,
    831             'sessionId' => 'debug-session',
    832             'runId' => 'run1',
    833             'hypothesisId' => 'SHADOW'
    834         );
    835         file_put_contents($log_file, json_encode($log_shadow) . "\n", FILE_APPEND);
    836         // #endregion
    837640
    838641        if ( isset( $atts['shadow'] ) && $atts['shadow'] ) {
  • sfr-book-review-showcase/trunk/readme.txt

    r3451599 r3459918  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.4.0
     7Stable tag: 1.4.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4141**Upgrade to Pro for Advanced Features:**
    4242
    43 Looking for more power? [SFR Book Review Showcase Pro](https://supportfromrichard.co.uk/brs-pro-plugin) includes:
     43Looking for more power? [SFR Book Review Showcase Pro](https://supportfromrichard.co.uk/sfr-book-review-showcase/?utm_source=WordPress+Repo&utm_medium=referral&utm_campaign=wp-repo) includes:
    4444
    4545* **Advanced Analytics & Reporting** – Enhanced analytics dashboards with scheduled email reports (weekly/monthly)
     
    5151* **Premium Layout Templates** – Additional professional layout options
    5252
    53 Pro version available at: https://supportfromrichard.co.uk/brs-pro-plugin
     53[Free Pro Trial (no credit card required)](https://supportfromrichard.co.uk/sfr-book-review-showcase/?utm_source=WordPress+Repo&utm_medium=referral&utm_campaign=wp-repo)
    5454
    5555*This plugin is not affiliated with, endorsed by, or sponsored by Amazon. Amazon is a trademark of Amazon.com, Inc.*
     
    9090* **Premium Layout Templates** – Additional professional design options
    9191
    92 Learn more and upgrade at: https://supportfromrichard.co.uk/brs-pro-plugin
     92[Free Pro Trial (no credit card required)](https://supportfromrichard.co.uk/sfr-book-review-showcase/?utm_source=WordPress+Repo&utm_medium=referral&utm_campaign=wp-repo)
    9393
    9494**Shortcode & Block Usage**
     
    122122== Changelog ==
    123123
     124= 1.4.1 =
     125* Fix: Removed debug logging statements accidentally left in production code that caused file_put_contents errors on live sites
     126
    124127= 1.4.0 =
    125128* Removed Freemius SDK – Rolled back to pre-Freemius codebase (1.2.2). Plugin now uses standard WordPress.org update checks. Upgrade to Pro via link in menu.
     
    367370== Upgrade Notice ==
    368371
     372= 1.4.1 =
     373Hotfix: Removed debug logging that caused errors on live sites. All users on 1.4.0 should update immediately.
     374
    369375= 1.4.0 =
    370376Removed Freemius SDK. Rolled back to pre-Freemius codebase. Plugin uses WordPress.org update checks. Upgrade to Pro via menu link. Safe to update - no action required.
  • sfr-book-review-showcase/trunk/sfr-book-review-showcase.php

    r3451599 r3459918  
    44 * Plugin URI:        https://supportfromrichard.co.uk/plugins/sfr-book-review-showcase
    55 * Description:       Showcase book reviews from Amazon on your WordPress site with customisable layouts, easy imports, and built-in analytics.
    6  * Version:           1.4.0
     6 * Version:           1.4.1
    77 * Author:            Support From Richard
    88 * Author URI:        https://supportfromrichard.co.uk
     
    1818
    1919if ( ! defined( 'SFRBRS_VERSION' ) ) {
    20     define( 'SFRBRS_VERSION', '1.4.0' );
     20    define( 'SFRBRS_VERSION', '1.4.1' );
    2121}
    2222
Note: See TracChangeset for help on using the changeset viewer.