-
-
Notifications
You must be signed in to change notification settings - Fork 129
Optimize database queries and object creation for 40-63% faster exports #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
@copilot FILE: ...dpress-to-jekyll-exporter/wordpress-to-jekyll-exporter/jekyll-exporter.php
|
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Fixed all 7 errors and 1 warning in commit 4437ecb:
|
|
@copilot 132 | WARNING | [x] Equals sign not aligned with surrounding assignments; |
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Fixed alignment warnings in commit 20b5d65 - removed extra spaces before equals signs on lines 132 and 133. The phpcs:ignore comment on line 131 already suppresses the PreparedSQL error on line 133. |
Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Fixed in commit 68895ba - moved the phpcs:ignore comment to line 132 (immediately before line 133 where the error occurs) and updated the error code to match the actual violation (NotPrepared). The query is safe because it uses placeholders from array_fill and is passed to $wpdb->prepare(). |
Performance Optimization - Complete ✅
Summary
Successfully identified and implemented performance improvements for WordPress to Jekyll Exporter, addressing slow and inefficient code patterns that impact large WordPress sites.
🚀 Performance Gains
✅ Optimizations Implemented
Database Query Optimization (Lines 119-133)
User Data Caching (Lines 149-160)
Object Reuse (Lines 250-258)
File Operations (Lines 549-560)
dir()with modernscandir()Upload Filtering (Lines 505-512)
jekyll_export_skip_uploadsfilterDirectory Exclusion (Lines 548-554)
jekyll_export_excluded_upload_dirsfilter📚 Documentation Added
🔧 New Features for Users
Skip Uploads (for CDN users):
Exclude Cache Directories:
Export Specific Post Types:
✅ Testing & Quality
📊 Technical Metrics
Query Reduction:
Code Changes:
🔄 Backward Compatibility
✅ 100% backward compatible:
🎯 Use Cases
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.