Sync PR from Main to Dev after 1.4.9#1424
Conversation
Develop to Main Sync for 1.4.9
* fix: Negative storage available * fix: Bandwidth and Storage limit issues * fix: Update banner padding * fix: Update Free Plan text in API Key section * chore: Make Bandwidth and Storage limit exceeded numbers bold * fix: Account Link * fix: Admin Notice links
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
missing_composer_json_file | The "/vendor" directory using composer exists, but "composer.json" file is missing. |
📁 readme.txt (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 inc/classes/media-library/class-media-folder-utils.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
91 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $where_clause used in $wpdb->get_var($wpdb->prepare(\n\t\t\t\t"\n\t\t\tSELECT COUNT(DISTINCT p.ID)\n\t\t\tFROM {$wpdb->posts} p\n\t\t\tINNER JOIN {$wpdb->term_relationships} tr ON p.ID = tr.object_id\n\t\t\tINNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id\n\t\t\tWHERE {$where_clause}\n\t\t",\n\t\t\t\t$query_params\n\t\t\t))\n$where_clause assigned unsafely at line 82:\n $where_clause .= ' AND p.post_mime_type LIKE %s'\n$query_params[] used without escaping.\n$mime_type used without escaping. |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (6 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?p=1 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?page_id=2 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?attachment_id=6 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?godam-video=demo-godam-video-post (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (6 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?p=1 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?page_id=2 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?attachment_id=6 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?godam-video=demo-godam-video-post (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
There was a problem hiding this comment.
Pull request overview
This PR syncs changes from the main branch to the dev branch following the 1.4.9 release. The release focuses on adding a free trial plan, implementing storage/bandwidth limit warnings, and fixing various UI issues.
- Version bump from 1.4.8 to 1.4.9 across all relevant files
- Added free trial promotional notice with 7-day dismissal mechanism
- Implemented comprehensive storage/bandwidth limit checking with user-facing notices and transcoding blocks
- Updated UI components for better storage limit awareness
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| readme.txt | Updated stable tag to 1.4.9, added v1.4.9 changelog entry, removed old v1.4.6 changelog |
| pages/whats-new/index.scss | Changed card image layout from fixed height with cover to flexible container with centered content |
| pages/tools/retranscode-media.scss | Added styling for storage exceeded notice banner |
| pages/tools/components/tabs/RetranscodeTab.jsx | Added storage limit checks, disabled retranscode button when storage exceeded, improved translator comments |
| pages/godam/components/tabs/VideoSettings/components/PasswordFieldWIthToggle/index.jsx | Updated API key link URL path from my-account to billing, improved text spacing |
| pages/godam/components/tabs/VideoSettings/VideoSettings.jsx | Added promotional text about free trial |
| pages/godam/components/tabs/VideoSettings/UsageData.jsx | Removed error-based conditional rendering, simplified to always show bandwidth/storage stats with null-safe defaults |
| pages/godam/components/GoDAMHeader.jsx | Added API key validation check before fetching site data |
| package.json | Version bump to 1.4.9 |
| package-lock.json | Version bump to 1.4.9 |
| languages/godam.pot | Updated translations with new version, added storage/bandwidth limit messages, updated references to New Year Sale 2026 |
| inc/helpers/custom-functions.php | Added logic to set storageBandwidthError messages when limits are exceeded |
| inc/classes/rest-api/class-transcoding.php | Added storage limit checks in retranscode endpoints to block operations when exceeded |
| inc/classes/class-media-library-ajax.php | Simplified blocked status check to use cached user data instead of direct API calls |
| godam.php | Updated plugin version constant to 1.4.9 |
| assets/src/css/admin.scss | Changed banner background color from black to burgundy (#AB3A6C) |
| admin/class-rtgodam-transcoder-handler.php | Updated to use cached user data for storage checks instead of direct API calls |
| admin/class-rtgodam-transcoder-admin.php | Added comprehensive usage limit notices, updated free plan notice to 7-day dismissal, changed promotional message to emphasize 60-day free trial |
| README.md | Updated stable tag to 1.4.9 |
| CHANGELOG.md | Added v1.4.9 changelog entry |
Comments suppressed due to low confidence (1)
admin/class-rtgodam-transcoder-admin.php:362
- Using event delegation with $(document).on() is good, but the immediate fadeOut on line 353 could cause a race condition where the notice disappears before the AJAX request completes. If the AJAX request fails, the user won't see an error and the dismissal won't be saved. Consider hiding the notice only after successful AJAX completion, or at minimum handle AJAX errors.
// Use event delegation to handle the click even if the button is added dynamically
$(document).on('click', '.rtgodam-free-plan-notice .notice-dismiss', function() {
var $notice = $(this).closest('.rtgodam-free-plan-notice');
// Hide the notice immediately when clicked
$notice.fadeOut();
// Store dismissal timestamp via AJAX
var url = (typeof ajaxurl !== 'undefined') ? ajaxurl : 'admin-ajax.php';
$.post(url, {
action: 'rtgodam_dismiss_free_plan_notice',
nonce: '<?php echo esc_js( wp_create_nonce( 'dismiss_free_plan_notice' ) ); ?>'
});
});
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const storageExceeded = useMemo( () => { | ||
| const userData = window?.userData || {}; | ||
| const storageUsed = Number( userData.storageUsed || 0 ); | ||
| const totalStorage = Number( userData.totalStorage || 0 ); | ||
| return storageUsed > totalStorage; | ||
| }, [] ); |
There was a problem hiding this comment.
The useMemo hook has an empty dependency array, which means it will only calculate the storage status once on mount. However, userData can change during the component's lifecycle (e.g., after transcoding operations or cache refresh). The dependency array should include the values being computed from, or useMemo should be removed if reactive recalculation isn't needed.
| <div> | ||
| <p style="font-size: 16px; font-weight: 600; margin-bottom: 15px;"> | ||
| <?php esc_html_e( 'GoDAM now has a Free Plan with 20GB of storage and bandwidth. Unlimited sites and users.', 'godam' ); ?> | ||
| <?php esc_html_e( 'Try GoDAM free for 60 days with all features, unlimited sites and users.', 'godam' ); ?> |
There was a problem hiding this comment.
The notice message has changed from mentioning "Free Plan with 20GB" to "free for 60 days", but the function name and related variables still reference "free_plan". Consider updating the naming to reflect the actual feature (e.g., "trial_notice" or "free_trial_notice") to avoid confusion in the codebase.
| { sprintf( | ||
| // translators: %s is the storage usage percentage. | ||
| __( 'Your storage usage has exceeded your plan limit (%s%%). Retranscoding is currently blocked. Please upgrade your plan to continue.', 'godam' ), | ||
| ( ( Number( window?.userData?.storageUsed || 0 ) / Math.max( 1, Number( window?.userData?.totalStorage || 0 ) ) ) * 100 ).toFixed( 1 ), |
There was a problem hiding this comment.
The storage percentage calculation is duplicated here and in the useMemo hook at line 40-44. Consider extracting this calculation into a helper function or reusing the value from the useMemo to maintain DRY principles and ensure consistency.
| // Only fetch site data if there's a valid API key | ||
| if ( ! window?.userData?.validApiKey ) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
The early return check for validApiKey prevents the entire useEffect from running, but the useEffect has no dependencies array specified. This means on re-renders, if the API key becomes valid later, the effect won't re-run to fetch the media link. Consider adding window?.userData?.validApiKey to the dependency array (or the specific properties being checked) so the effect re-runs when the API key status changes.
No description provided.