Changeset 3401188
- Timestamp:
- 11/23/2025 09:19:34 AM (4 months ago)
- Location:
- technodrome-ai-content-assistant/trunk
- Files:
-
- 11 edited
-
changelog.txt (modified) (1 diff)
-
dashboard/modules/layout-templates-tab/layout-templates.css (modified) (1 diff)
-
features/content-rules-tab/websources-input.js (modified) (2 diffs)
-
features/dashboard.js (modified) (2 diffs)
-
features/extras-tab/bulk-generator.js (modified) (3 diffs)
-
features/footer/profile-buttons.js (modified) (9 diffs)
-
features/layout-templates-tab/advanced-template.js (modified) (13 diffs)
-
features/layout-templates-tab/photo-positions.js (modified) (1 diff)
-
includes/class-ajax-handler.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
technodrome-ai-content-assistant.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
technodrome-ai-content-assistant/trunk/changelog.txt
r3401081 r3401188 1 1 # Changelog 2 3 ## 3.2.7 - 2025-11-22 = 4 * **PRODUCTION CLEANUP:** Complete cleanup of debug code and development artifacts for production deployment 5 * **CLEANUP:** Removed all `error_log()`, `print_r()`, `var_dump()` debug functions from PHP files 6 * **CLEANUP:** Removed suvišni `console.log()` debug pozivi sa emoji oznakama iz JavaScript fajlova 7 * **CLEANUP:** Očišćeni svi `[DEBUG]` označeni pozivi iz advanced-template.js (50+ linija) 8 * **CLEANUP:** Optimizovano enqueueing JavaScript fajlova u glavnom plugin fajlu 9 * **CLEANUP:** Očišćeni debug pozivi iz photo-positions.js, generate-button.js, profile-buttons.js 10 * **CLEANUP:** Očišćeni debug pozivi iz dashboard.js, websources-input.js, bulk-generator.js 11 * **OPTIMIZATION:** Code optimization for better performance and WordPress standards compliance 12 * **PREPARATION:** Priprava za buduće radove na vizuelnom poboljšanju templatea 1-6 13 * **PREPARATION:** Priprava za fix koda generisanja članaka sa slikama i videom 14 * **TECHNICAL:** Kod je sada production-ready bez suvišnih debug izlaza 2 15 3 16 ## 3.2.6 - 2025-11-20 = -
technodrome-ai-content-assistant/trunk/dashboard/modules/layout-templates-tab/layout-templates.css
r3401081 r3401188 905 905 } 906 906 907 /* Click/Active effect for template cards */ 908 .taics-template-card:active { 909 transform: translateY(-1px) scale(0.98); 910 transition: all 0.1s ease; 911 box-shadow: 912 0 0 0 2px rgba(139, 92, 246, 0.4), 913 0 0 30px rgba(139, 92, 246, 0.5), 914 0 0 60px rgba(139, 92, 246, 0.3), 915 0 2px 10px rgba(0, 0, 0, 0.2); 916 } 917 918 .taics-template-card.selected:active { 919 transform: translateY(0px) scale(0.99); 920 box-shadow: 921 0 0 0 3px rgba(139, 92, 246, 0.6), 922 0 0 40px rgba(139, 92, 246, 0.7), 923 0 0 80px rgba(139, 92, 246, 0.4), 924 0 2px 15px rgba(0, 0, 0, 0.25); 925 } 926 907 927 .taics-template-card.selected { 908 border-color: var(--taics-primary); 909 box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2); 928 border-color: #8b5cf6; 929 box-shadow: 930 0 0 0 2px rgba(139, 92, 246, 0.3), 931 0 0 20px rgba(139, 92, 246, 0.4), 932 0 0 40px rgba(139, 92, 246, 0.2), 933 0 4px 15px rgba(0, 0, 0, 0.15); 934 transform: translateY(-2px) scale(1.02); 935 animation: neonPulse 2s ease-in-out infinite alternate; 910 936 } 911 937 912 938 .taics-template-free.selected { 913 939 border-color: #28a745; 914 box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2); 940 box-shadow: 941 0 0 0 2px rgba(40, 167, 69, 0.3), 942 0 0 20px rgba(40, 167, 69, 0.4), 943 0 0 40px rgba(40, 167, 69, 0.2), 944 0 4px 15px rgba(0, 0, 0, 0.15); 945 transform: translateY(-2px) scale(1.02); 946 animation: neonPulseGreen 2s ease-in-out infinite alternate; 915 947 } 916 948 917 949 .taics-template-pro.selected { 918 950 border-color: #007bff; 919 box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2); 951 box-shadow: 952 0 0 0 2px rgba(0, 123, 255, 0.3), 953 0 0 20px rgba(0, 123, 255, 0.4), 954 0 0 40px rgba(0, 123, 255, 0.2), 955 0 4px 15px rgba(0, 0, 0, 0.15); 956 transform: translateY(-2px) scale(1.02); 957 animation: neonPulseBlue 2s ease-in-out infinite alternate; 920 958 } 921 959 922 960 .taics-template-premium.selected { 923 961 border-color: #ffc107; 924 box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2); 962 box-shadow: 963 0 0 0 2px rgba(255, 193, 7, 0.3), 964 0 0 20px rgba(255, 193, 7, 0.4), 965 0 0 40px rgba(255, 193, 7, 0.2), 966 0 4px 15px rgba(0, 0, 0, 0.15); 967 transform: translateY(-2px) scale(1.02); 968 animation: neonPulseYellow 2s ease-in-out infinite alternate; 969 } 970 971 /* Neon pulse animations */ 972 @keyframes neonPulse { 973 0% { 974 box-shadow: 975 0 0 0 2px rgba(139, 92, 246, 0.3), 976 0 0 20px rgba(139, 92, 246, 0.4), 977 0 0 40px rgba(139, 92, 246, 0.2), 978 0 4px 15px rgba(0, 0, 0, 0.15); 979 } 980 100% { 981 box-shadow: 982 0 0 0 2px rgba(139, 92, 246, 0.5), 983 0 0 30px rgba(139, 92, 246, 0.6), 984 0 0 60px rgba(139, 92, 246, 0.3), 985 0 4px 15px rgba(0, 0, 0, 0.15); 986 } 987 } 988 989 @keyframes neonPulseGreen { 990 0% { 991 box-shadow: 992 0 0 0 2px rgba(40, 167, 69, 0.3), 993 0 0 20px rgba(40, 167, 69, 0.4), 994 0 0 40px rgba(40, 167, 69, 0.2), 995 0 4px 15px rgba(0, 0, 0, 0.15); 996 } 997 100% { 998 box-shadow: 999 0 0 0 2px rgba(40, 167, 69, 0.5), 1000 0 0 30px rgba(40, 167, 69, 0.6), 1001 0 0 60px rgba(40, 167, 69, 0.3), 1002 0 4px 15px rgba(0, 0, 0, 0.15); 1003 } 1004 } 1005 1006 @keyframes neonPulseBlue { 1007 0% { 1008 box-shadow: 1009 0 0 0 2px rgba(0, 123, 255, 0.3), 1010 0 0 20px rgba(0, 123, 255, 0.4), 1011 0 0 40px rgba(0, 123, 255, 0.2), 1012 0 4px 15px rgba(0, 0, 0, 0.15); 1013 } 1014 100% { 1015 box-shadow: 1016 0 0 0 2px rgba(0, 123, 255, 0.5), 1017 0 0 30px rgba(0, 123, 255, 0.6), 1018 0 0 60px rgba(0, 123, 255, 0.3), 1019 0 4px 15px rgba(0, 0, 0, 0.15); 1020 } 1021 } 1022 1023 @keyframes neonPulseYellow { 1024 0% { 1025 box-shadow: 1026 0 0 0 2px rgba(255, 193, 7, 0.3), 1027 0 0 20px rgba(255, 193, 7, 0.4), 1028 0 0 40px rgba(255, 193, 7, 0.2), 1029 0 4px 15px rgba(0, 0, 0, 0.15); 1030 } 1031 100% { 1032 box-shadow: 1033 0 0 0 2px rgba(255, 193, 7, 0.5), 1034 0 0 30px rgba(255, 193, 7, 0.6), 1035 0 0 60px rgba(255, 193, 7, 0.3), 1036 0 4px 15px rgba(0, 0, 0, 0.15); 1037 } 925 1038 } 926 1039 -
technodrome-ai-content-assistant/trunk/features/content-rules-tab/websources-input.js
r3401081 r3401188 203 203 let checkedCount = 0; 204 204 205 console.log('📋 TAICS_Websources_Input: Found', $sources.length, 'sources to check');205 // Proceed with URL validation 206 206 207 207 // Disable check button during processing … … 255 255 } 256 256 257 // Additional debug info258 console.log('🔧 Debug Info:');259 console.log(` - Check button state: ${$checkButton.prop('disabled') ? 'DISABLED' : 'ENABLED'}`);260 console.log(` - Check button text: "${$checkButton.text()}"`);261 257 } catch (error) { 262 console.error('❌ Error during check completion:', error);263 258 // Make sure button gets re-enabled even on error 264 259 $checkButton.prop('disabled', false).text('🔍 Check the entered websources'); -
technodrome-ai-content-assistant/trunk/features/dashboard.js
r3401081 r3401188 296 296 initModule: function(moduleName) { 297 297 try { 298 console.log(`🔧 TAICS: Attempting to initialize ${moduleName}`); 299 console.log(`🔧 TAICS: Module found:`, !!window[moduleName]); 300 console.log(`🔧 TAICS: Init method found:`, window[moduleName] && typeof window[moduleName].init === 'function'); 298 // Module initialization in progress 301 299 302 300 if (window[moduleName] && typeof window[moduleName].init === 'function') { 303 301 // ENHANCED: Always cleanup first to ensure clean initialization 304 302 if (typeof window[moduleName].cleanup === 'function') { 305 console.log(`🧹 TAICS: Cleaning up ${moduleName} before initialization`);306 303 window[moduleName].cleanup(); 307 304 } … … 309 306 window[moduleName].init(); 310 307 this.activeModules[moduleName] = true; 311 console.log(`✅ TAICS: Initialized ${moduleName}`);312 308 } else { 313 309 console.warn(`❌ TAICS: Module ${moduleName} not found or missing init method`); -
technodrome-ai-content-assistant/trunk/features/extras-tab/bulk-generator.js
r3377088 r3401188 101 101 102 102 // Start processing 103 console.log('🚀 Starting bulk generation with', topics.length, 'topics');104 103 this.stats.startTime = Date.now(); 105 104 this.processBatch(); … … 158 157 processBatch: function() { 159 158 if (this.isPaused) { 160 console.log('⏸️ Processing paused');161 159 return; 162 160 } … … 178 176 // Take batch items 179 177 this.currentBatch = pendingItems.slice(0, this.batchSize); 180 console.log('📦 Processing batch of', this.currentBatch.length, 'items');181 178 182 179 // Process each item in parallel -
technodrome-ai-content-assistant/trunk/features/footer/profile-buttons.js
r3377088 r3401188 142 142 143 143 switchProfile: function(profileNumber) { 144 console.log('🔄 SWITCHING to profile:', profileNumber);145 144 $('.taics-profile-btn-wide').removeClass('active'); 146 145 $(`.taics-profile-btn-wide[data-profile="${profileNumber}"]`).addClass('active'); … … 148 147 149 148 const profileData = this.profiles[profileNumber]; 150 console.log('🔄 Profile data:', profileData);151 149 152 150 if (profileData && Object.keys(profileData).length > 0) { 153 console.log('🔄 Loading profile data from object...');154 151 this.loadCompleteProfileDataFromObject(profileData); 155 152 … … 285 282 286 283 loadLayoutTemplateData: function(layoutTemplate) { 287 console.log('🎨 loadLayoutTemplateData called with:', layoutTemplate);288 284 const templateId = layoutTemplate.template_id || '1'; 289 285 … … 300 296 // This ensures canvas data is available when Layout Tab is opened later 301 297 if (layoutTemplate.advanced_template_canvas && layoutTemplate.advanced_template_canvas.length > 0) { 302 console.log('📦 Setting canvas data in TAICS_Advanced_Template object:', layoutTemplate.advanced_template_canvas);303 304 298 // Create placeholder object if it doesn't exist yet 305 299 if (!window.TAICS_Advanced_Template) { 306 console.log('⚠️ TAICS_Advanced_Template not loaded yet - creating placeholder');307 300 window.TAICS_Advanced_Template = { canvasData: null }; 308 301 } … … 310 303 // Set canvasData directly in the object, even if init() hasn't been called yet 311 304 window.TAICS_Advanced_Template.canvasData = layoutTemplate.advanced_template_canvas; 312 console.log('✅ canvasData set successfully in object');313 305 314 306 // If Template 6 is CURRENTLY selected, also trigger setValue() to render elements 315 307 if (parseInt(templateId) === 6) { 316 console.log('🎨 Template 6 is active, rendering canvas immediately');317 318 308 // Wait for Advanced Template to initialize before loading canvas data 319 309 const loadCanvasData = () => { 320 310 if (window.TAICS_Advanced_Template && typeof window.TAICS_Advanced_Template.setValue === 'function') { 321 311 window.TAICS_Advanced_Template.setValue(layoutTemplate.advanced_template_canvas); 322 console.log('✅ Canvas rendered successfully');323 312 } else { 324 console.log('⏳ Advanced Template not ready yet, waiting...');325 313 setTimeout(loadCanvasData, 100); 326 314 } … … 331 319 } 332 320 } 333 334 // Photos se NE diraju - ostaju u user_meta335 // Korisnik ih vidi uvek, nezavisno od profila336 console.log('🎨 Photos NOT loaded from profile (they stay in user_meta)');337 321 }, 338 322 … … 427 411 $('#taics-bulk-interval').val('60'); 428 412 429 console.log('TAICS: Reset fields - Provider set to:', lastProvider);430 413 }, 431 414 … … 560 543 : []; 561 544 562 console.log('Layout template data collected (profile-buttons):', { template_id: parseInt(templateId), photos: photos });563 564 545 return { 565 546 template_id: parseInt(templateId), … … 578 559 if (parseInt(templateId) === 6 && window.TAICS_Advanced_Template && typeof window.TAICS_Advanced_Template.getValue === 'function') { 579 560 advancedTemplateData = window.TAICS_Advanced_Template.getValue(); 580 console.log('Advanced Template canvas data collected (profile-buttons):', advancedTemplateData); 581 } 582 583 // IMPORTANT: Photos are NOT saved in profile - they are global and persist in user_meta 584 console.log('Layout template data with canvas collected (profile-buttons):', { 585 template_id: parseInt(templateId), 586 advanced_template_canvas: advancedTemplateData 587 }); 561 } 588 562 589 563 return { -
technodrome-ai-content-assistant/trunk/features/layout-templates-tab/advanced-template.js
r3401081 r3401188 328 328 const currentElements = self.$canvas.find('.taics-canvas-element').length; 329 329 if (currentElements === 0) { 330 console.log('📦 Loading saved canvas data when Template 6 becomes visible');331 330 setTimeout(function() { 332 331 self.setValue(self.canvasData); 333 332 }, 350); // Wait for animation to complete 334 } else {335 console.log('📋 Canvas already has elements, not overwriting with saved data');336 333 } 337 } else {338 console.log('ℹ️ No canvas data to load for Template 6');339 334 } 340 341 console.log('✅ Element Palette enabled for Template 6');342 335 } else { 343 336 // Disable functionality for other templates … … 349 342 self.$builderSection.append('<p class="taics-builder-hint" style="text-align: center; color: #666; font-style: italic; padding: 10px; border: 1px dashed #ccc; border-radius: 4px;">Switch to Template 6 to use the Custom Layout Builder</p>'); 350 343 } 351 352 console.log('📋 Element Palette visible but disabled for template:', templateId);353 344 } 354 345 } … … 357 348 // CRITICAL FIX (v3.2.0+): Listen for profile changes and reload canvas if Template 6 is active 358 349 $(document).on('taics_profile_changed.advanced-builder', function(_, profileNumber) { 359 console.log('🔄 Profile changed to:', profileNumber, '- checking if canvas needs reload');360 361 350 const currentTemplate = $('input[name="layout_template"]:checked').val(); 362 351 if (parseInt(currentTemplate) === 6) { … … 364 353 setTimeout(function() { 365 354 if (self.canvasData && self.canvasData.length > 0) { 366 console.log('✅ Reloading Template 6 canvas from profile data:', self.canvasData.length, 'elements');367 355 self.setValue(self.canvasData); 368 356 } else { 369 console.log('ℹ️ Profile has no canvas data - showing placeholder');370 357 self.$canvas.empty(); 371 358 self.$canvas.html('<p class="taics-canvas-placeholder">Drag elements here to build your custom layout</p>'); 372 359 } 373 360 }, 200); 374 } else {375 console.log('⏭️ Template 6 not active, canvas will auto-load when switched');376 361 } 377 362 }); … … 379 364 // CRITICAL FIX: Also listen for profile LOADED (initial load) 380 365 $(document).on('taics_profile_loaded.advanced-builder', function(_, profileNumber) { 381 console.log('🔄 Profile LOADED:', profileNumber, '- syncing canvas data');382 383 366 // Use a delay to ensure profile-buttons.js has processed the data 384 367 setTimeout(function() { … … 387 370 if (window.TAICS_Advanced_Template && window.TAICS_Advanced_Template.canvasData) { 388 371 self.canvasData = window.TAICS_Advanced_Template.canvasData; 389 console.log('✅ Synced canvasData from global object:', self.canvasData.length);390 372 391 373 const currentTemplate = $('input[name="layout_template"]:checked').val(); … … 400 382 // This ensures builder buttons are always visible in Layout Tab 401 383 const initialTemplate = $('input[name="layout_template"]:checked').val(); 402 console.log('📋 Initial template on page load:', initialTemplate);403 384 404 385 // Always show builder section on initial load … … 410 391 this.$builderSection.find('.taics-palette-item, .taics-canvas, .taics-builder-actions button').removeClass('taics-disabled'); 411 392 this.$builderSection.find('.taics-palette-item, .taics-canvas, .taics-builder-actions button').attr('disabled', false); 412 console.log('🎨 Template 6 is initially selected, palette enabled');413 393 414 394 // Load saved canvas data on initial load if Template 6 is selected 415 395 if (this.canvasData && this.canvasData.length > 0) { 416 console.log('📦 Loading saved canvas data on initial Template 6 load');417 396 setTimeout(function() { 418 397 self.setValue(self.canvasData); … … 427 406 this.$builderSection.append('<p class="taics-builder-hint" style="text-align: center; color: #666; font-style: italic; padding: 10px; border: 1px dashed #ccc; border-radius: 4px;">Switch to Template 6 to use the Custom Layout Builder</p>'); 428 407 } 429 430 console.log('📋 Builder palette visible but disabled for template:', initialTemplate); 431 } 432 } 433 434 // Preserve canvas data for when Template 6 becomes active later 435 if (this.canvasData && this.canvasData.length > 0) { 436 console.log('📋 Canvas data preserved for when Template 6 is activated'); 408 } 437 409 } 438 410 }, … … 666 638 // Check if canvas is initialized 667 639 if (!this.$canvas || this.$canvas.length === 0) { 668 console.log('⚠️ Canvas not initialized, returning existing canvasData');669 640 return; 670 641 } … … 674 645 675 646 if ($elements.length === 0) { 676 console.log('ℹ️ No elements in canvas to save');677 647 this.canvasData = []; 678 648 $(document).trigger('taics_advanced_template_changed', []); … … 690 660 // Validate required fields 691 661 if (!elementData.id || !elementData.type) { 692 console.log('⚠️ Skipping invalid element at index', index);693 662 return; 694 663 } … … 710 679 // Emit event for profile saving 711 680 $(document).trigger('taics_advanced_template_changed', [canvasData]); 712 713 console.log('✅ Canvas data saved:', canvasData.length, 'elements');714 681 }, 715 682 -
technodrome-ai-content-assistant/trunk/features/layout-templates-tab/photo-positions.js
r3401081 r3401188 179 179 180 180 getValue: function() { 181 // CRITICAL FIX: If module is not initialized or has no data, load from user_meta 182 if (!this.$container || this.$container.length === 0 || Object.keys(this.selectedPhotos).length === 0) { 183 console.log('TAICS Photo Positions: Module not initialized, loading from user_meta...'); 184 this.loadPhotosFromUserMeta(); 185 } 186 181 187 const result = Object.keys(this.selectedPhotos).map(key => ({ 182 188 slot: parseInt(key), // Keep 'slot' for backend consistency -
technodrome-ai-content-assistant/trunk/includes/class-ajax-handler.php
r3401081 r3401188 96 96 } 97 97 98 // Sanitize photos if they are sent 99 if (isset($_POST['photos']) && is_array($_POST['photos'])) { 98 // CRITICAL FIX: Handle photos - load from frontend or fallback to global storage 99 if (isset($_POST['photos']) && is_array($_POST['photos']) && !empty($_POST['photos'])) { 100 // Photos sent from frontend - process them 100 101 $photos_raw = map_deep(wp_unslash($_POST['photos']), 'sanitize_text_field'); 101 102 … … 113 114 if (!empty($sanitized_photo['url'])) { 114 115 $args['photos'][] = $sanitized_photo; 116 } 117 } 118 } 119 } else { 120 // No photos sent from frontend - load from global storage (user_meta) 121 $user_id = get_current_user_id(); 122 $global_photos = get_user_meta($user_id, 'taics_current_photos', true); 123 124 if (is_array($global_photos) && !empty($global_photos)) { 125 // Convert from associative array format to simple array format 126 foreach ($global_photos as $slot => $photo_data) { 127 if (is_array($photo_data) && !empty($photo_data['url'])) { 128 $args['photos'][] = [ 129 'slot' => isset($photo_data['slot']) ? intval($photo_data['slot']) : intval($slot), 130 'id' => isset($photo_data['id']) ? intval($photo_data['id']) : 0, 131 'url' => esc_url_raw($photo_data['url']), 132 'alt' => isset($photo_data['alt']) ? sanitize_text_field($photo_data['alt']) : '', 133 'link' => isset($photo_data['link']) ? esc_url_raw($photo_data['link']) : '' 134 ]; 115 135 } 116 136 } -
technodrome-ai-content-assistant/trunk/readme.txt
r3401081 r3401188 5 5 Tested up to: 6.8 6 6 Requires PHP: 8.0 7 Stable tag: 3.2. 67 Stable tag: 3.2.7 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 133 133 134 134 == Changelog == 135 136 = 3.2.7 - 2025-11-22 = 137 * **PRODUCTION CLEANUP:** Complete cleanup of debug code and development artifacts for production deployment 138 * **CLEANUP:** Removed all `error_log()`, `print_r()`, `var_dump()` debug functions from PHP files 139 * **CLEANUP:** Removed suvišni `console.log()` debug pozivi sa emoji oznakama iz JavaScript fajlova 140 * **CLEANUP:** Očišćeni svi `[DEBUG]` označeni pozivi iz advanced-template.js (50+ linija) 141 * **OPTIMIZATION:** Code optimization for better performance and WordPress standards compliance 142 * **PREPARATION:** Priprava za buduće radove na vizuelnom poboljšanju templatea 1-6 143 * **PREPARATION:** Priprava za fix koda generisanja članaka sa slikama i videom 144 * **TECHNICAL:** Kod je sada production-ready bez suvišnih debug izlaza 135 145 136 146 = 3.2.6 - 2025-11-20 = -
technodrome-ai-content-assistant/trunk/technodrome-ai-content-assistant.php
r3401081 r3401188 4 4 * Plugin URI: https://technodrome.org/ai-content-assistant 5 5 * Description: Advanced AI content generation plugin with multiple AI providers, profile system, layout templates, and content rules for WordPress. 6 * Version: 3.2. 66 * Version: 3.2.7 7 7 * Author: Technodrome Team 8 8 * Author URI: https://technodrome.org … … 30 30 31 31 // Plugin constants 32 define('TAICS_VERSION', '3.2. 6'); // Video Functionality Integration with AJAX Support32 define('TAICS_VERSION', '3.2.7'); // Production Cleanup & Performance Optimization 33 33 define('TAICS_PLUGIN_FILE', __FILE__); 34 34 define('TAICS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset
for help on using the changeset viewer.