Repository navigation
Retranscode only media items, with an hourly limit below Editor - #2385
Closed
subodhr258 wants to merge 2 commits into
Closed
subodhr258 wants to merge 2 commits into
subodhr258 wants to merge 2 commits into
Conversation
The retranscode route let anyone who can edit an ID retranscode it, so a Contributor could send their own draft post, which is not media. It now also requires an attachment. Users below Editor can start 10 retranscodes an hour (filter rtgodam_retranscode_hourly_limit), so an Author looping over their uploads cannot burn the site's GoDAM plan. Editors and above, who use the bulk Retranscoding page, are not limited.
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Video Hosting for LMS & Online Courses" is different from the name declared in plugin header "GoDAM". |
📁 assets/build/pages/video-editor.min.js (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
2 |
react_removed_api | This file calls "ReactDOM.findDOMNode", which was removed in React 19 and stops working once WordPress upgrades React. Use a ref on the element instead. |
📁 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 (5 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/2026/11/17/hello-world/ (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/sample-page/ (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/demo-attachment-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 (5 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/2026/11/17/hello-world/ (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/sample-page/ (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/demo-attachment-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
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
2.10.0 opened the retranscode route (
POST /godam/v1/transcoding/retranscode, also used bygodam/retranscode-media) to anyone who can edit the item, so an Author can redo their own uploads. Two gaps from the security check of the release:edit_poston the ID, so a Contributor could send their own draft post, which is not media. On godam-multisite.local a Contributor'sPOSTwith their draft's ID passed the permission check (it stopped later only because the site is local). The route now also requires an attachment.rtgodam_retranscode_hourly_limit, 0 turns it off). Editors and above, who use the bulk Retranscoding page, are not limited.Patch-level: not a data leak, and the ability itself already refused non-media IDs. Listed under "Can follow in a patch" on https://github.com/rtCamp/godam-plugin-wp/issues/106.
Where to look
The parts a human reviewer should spend their time on. Everything else is mechanical: the test and the regenerated POT.
inc/classes/rest-api/class-transcoding.php:802-818)inc/classes/rest-api/class-transcoding.php:829-870, called at the top ofretranscode_media())reason: rate_limited, which the ability turns into an error with that message.UI evidence
No UI change: the route answers 403 or 429 where it used to run; Editors (who use the Retranscoding page) see no difference. Live check on godam-multisite.local:
POST .../retranscodewith own draft post IDHow to test
POST /wp-json/godam/v1/transcoding/retranscodewith{"id": <own draft post ID>}: expect 403.godam-retranscode-mediaon one of your videos 11 times: the 11th answers with the hourly-limit message.vendor/bin/phpunit --filter RetranscodePermissionTest.Risk
risk: lowbecause it only narrows who can retranscode what; Editors and the bulk page are unchanged.