Fix black colour defaults + license-helper PHP warning - #9
Merged
Conversation
Card 10251759307 - Button colour pickers default to black on fresh install: the four colour inputs (background, hover background, border, hover text) fell back to an empty string when infinite_loader_admin_button_option had no saved value, and a native input type=color paints black on an empty value. They now fall back to the same documented defaults the shop button actually renders (#1d76da / #0e4da0 / #1d76da / #ffffff), so a fresh install shows the intended colours in the pickers and on the Load More button. Fixed the identical bug on the sibling Load Previous button tab (its hover-text even fell back to #000), and aligned the border picker's stale data-default/data-color (#000 -> #1d76da). Card 10251759327 - License-helper PHP warning: edd_infinite_loader_active_license_message() returned null on any admin page that is not plugins.php / index.php / wbcom-license-page, but the renderer (hooked to the shared wbcom_add_plugin_license_code action) always reads $license_output['message'], producing "Trying to access array offset on value of type null ... line 428". The helper now always returns a well-formed array (message + license_data object with a license property) on every path, so any consumer of the shared hook can read it without a warning. EDD/SL license integration is left fully intact.
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.
Fixes two Bugs-column cards on woo.local (branch @ latest, v1.3.1).
Card 10251759307 - Button colour pickers default to black on fresh install
Root cause: On the Button Style tab, the four colour inputs (background, hover background, border, hover text) fell back to
''wheninfinite_loader_admin_button_optionhad no saved value. A native<input type="color">paints#000000on an empty value, so a fresh install rendered black pickers - and the shop Load More button - instead of the documented brand colours.Fix: Each colour input now falls back to the same default the shop button actually renders (
#1d76dabackground,#0e4da0hover background,#1d76daborder,#ffffffhover text - sourced from the activator seed, the public render, and the JS "Default" buttons, which all already agreed). The staledata-default="#000"/data-color="#000"on the border picker was aligned to#1d76dato match.Seam sweep: The sibling Load Previous button tab carried the identical empty-fallback bug on the same four fields (its hover-text even fell back to
#000); fixed there too.Evidence (woo.local, option unset):
#000000, hover-bg#000000, border#000000, hover-text#000000#1d76da, hover-bg#0e4da0, border#1d76da, hover-text#ffffffCard 10251759327 - License-helper PHP warning
Root cause:
edd_infinite_loader_active_license_message()only returned an array onplugins.php/index.php/page=wbcom-license-page, returningnull(andfalseon WP error) elsewhere. Its renderer is hooked to the sharedwbcom_add_plugin_license_codeaction, so any other admin page that renders the section hit$license_output['message']onnull:PHP Warning: Trying to access array offset on value of type null in edd-license/edd-plugin-license.php on line 428Fix: The helper now always returns a well-formed array (
messagestring +license_dataobject carrying alicenseproperty) on every path - off-page, WP-error, and success - so any consumer of the shared hook reads it without a warning. The EDD/SL license integration is left fully intact (noitem_id/item_namechanges, no EDD removal). Also collapsed the duplicatedis_wp_errorbranch and guarded a non-objectjson_decoderesult.Evidence (woo.local, WP_DEBUG_LOG on, rendered via the production hook on a non-license page):
line 428null-offset warning in debug.logVerification
bash bin/build-release.shgreen (version agreement, PHP lint, build-freshness, artifact file assertions) - PHP-only change, no bundle rebuild needed.