-
-
Notifications
You must be signed in to change notification settings - Fork 72
code changes for wp.org review #183
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
Changes from all commits
eb7eb33
2ac2b83
b1ccc88
4bf997c
f77c609
fea1563
d203ec7
446595d
ac8c5b1
560e264
72c2821
6d4ba12
dfdb26a
9dfa485
e946b04
08a08f4
727882d
7158656
0d06eb1
1f881db
a782dd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| .invoice-box { | ||
| width: 100%; | ||
| margin: auto; | ||
| font-size: 16px; | ||
| line-height: 24px; | ||
| color: #555; | ||
| } | ||
|
|
||
| .invoice-box table { | ||
| width: 100%; | ||
| line-height: inherit; | ||
| text-align: left; | ||
| } | ||
|
|
||
| .invoice-box table td { | ||
| padding: 5px; | ||
| vertical-align: top; | ||
| } | ||
|
|
||
| .invoice-box table tr td:nth-child(2) { | ||
| text-align: right; | ||
| } | ||
|
|
||
| .invoice-box table tr.top table td { | ||
| padding-bottom: 20px; | ||
| } | ||
|
|
||
| .invoice-box table tr.top table td.title { | ||
| font-size: 45px; | ||
| line-height: 45px; | ||
| color: #333; | ||
| } | ||
|
|
||
| .invoice-box table tr.information table td { | ||
| padding-bottom: 40px; | ||
| } | ||
|
|
||
| .invoice-box table tr.heading td { | ||
| background: #eee; | ||
| border-bottom: 1px solid #ddd; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| .invoice-box table { | ||
| border-collapse: 1px; | ||
| } | ||
|
|
||
| .invoice-box table tr.heading th { | ||
| border-left: 1px solid #ddd; | ||
| border-right: 1px solid #ddd; | ||
| } | ||
|
|
||
| .invoice-box table tr.item td { | ||
| vertical-align: middle; | ||
| } | ||
|
|
||
| .invoice-box table tr.heading th { | ||
| background: #eee; | ||
| border-top: 1px solid #ddd; | ||
| border-bottom: 1px solid #ddd; | ||
| padding: 10px; | ||
| text-align: right; | ||
| font-weight: bold; | ||
| text-transform: uppercase; | ||
| font-size: 80%; | ||
| } | ||
|
|
||
| .invoice-box table tr.details td { | ||
| padding: 10px; | ||
| } | ||
|
|
||
| .invoice-box table tr.item td{ | ||
| border-bottom: 1px solid #eee; | ||
| padding: 10px; | ||
| } | ||
|
|
||
| .invoice-box table tr.item.last td { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| .invoice-box table tr.total td { | ||
| border-top: 2px solid #eee; | ||
| font-weight: bold; | ||
| padding-bottom: 60px; | ||
| padding-top: 10px; | ||
| text-align: right; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 600px) { | ||
| .invoice-box table tr.top table td { | ||
| width: 100%; | ||
| display: block; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .invoice-box table tr.information table td { | ||
| width: 100%; | ||
| display: block; | ||
| text-align: center; | ||
| } | ||
| } | ||
|
|
||
| /** RTL **/ | ||
| .rtl { | ||
| direction: rtl; | ||
|
|
||
| } | ||
|
|
||
| .rtl table { | ||
| text-align: right; | ||
| } | ||
|
|
||
| .rtl table tr td:nth-child(2) { | ||
| text-align: left; | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -134,7 +134,9 @@ | |||||||||||||||||
| "vendor/delight-im/cookie/.travis-ci-apache", | ||||||||||||||||||
| "vendor/doctrine", | ||||||||||||||||||
| ".distignore", | ||||||||||||||||||
| "encrypt-sectrets.php" | ||||||||||||||||||
| "encrypt-sectrets.php", | ||||||||||||||||||
| "scripts", | ||||||||||||||||||
| "mu-plugins" | ||||||||||||||||||
| ] | ||||||||||||||||||
|
Comment on lines
+137
to
140
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in archive.exclude entry: “encrypt-sectrets.php”. If the intent was to exclude “encrypt-secrets.php”, the current misspelling will not match and the file will be shipped. Patch: - "encrypt-sectrets.php",
+ "encrypt-secrets.php",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| }, | ||||||||||||||||||
| "extra": { | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -997,9 +997,9 @@ public function render_country() { | |||||||||||||||||
|
|
||||||||||||||||||
| if ($country_code) { | ||||||||||||||||||
| $html = sprintf( | ||||||||||||||||||
| '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" %s>%s</span>', | ||||||||||||||||||
| '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" role="tooltip" aria-label="%s">%s</span>', | ||||||||||||||||||
| $country_name, | ||||||||||||||||||
| wu_tooltip_text($country_name), | ||||||||||||||||||
| esc_attr($country_name), | ||||||||||||||||||
| wu_get_flag_emoji((string) $country_code) | ||||||||||||||||||
|
Comment on lines
+1000
to
1003
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainFix ARIA misuse and escape output in render_country(). role="tooltip" on a static span is incorrect and causes duplicate announcements; the flag is decorative because the country name is already printed. Also escape outputs per WP standards. - '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" role="tooltip" aria-label="%s">%s</span>',
- $country_name,
- esc_attr($country_name),
- wu_get_flag_emoji((string) $country_code)
+ '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" aria-hidden="true">%s</span>',
+ esc_html($country_name),
+ esc_html(wu_get_flag_emoji((string) $country_code))Optional (if you truly need a tooltip later): use a trigger with aria-describedby pointing to a hidden tooltip element, not role="tooltip" on the icon itself. To check for similar cases: 🏁 Script executed: #!/bin/bash
rg -nP -C2 'role\s*=\s*"tooltip"' --type=phpLength of output: 8035 Fix ARIA misuse and escape outputs across the codebase role="tooltip" is applied to static/decorative elements (causes duplicate screen-reader announcements). Replace decorative icons with aria-hidden="true", escape outputs with esc_html/esc_attr, and implement real tooltips using a trigger + aria-describedby when required. Prefer fixing the helper(s) in inc/functions/markup-helpers.php to avoid repetition. Occurrences to update (from your search):
Apply the local fix (example) for inc/admin-pages/class-customer-edit-admin-page.php: - '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" role="tooltip" aria-label="%s">%s</span>',
- $country_name,
- esc_attr($country_name),
- wu_get_flag_emoji((string) $country_code)
+ '<span>%s</span><span class="wu-flag-icon wu-w-5 wu-ml-1" aria-hidden="true">%s</span>',
+ esc_html($country_name),
+ esc_html(wu_get_flag_emoji((string) $country_code))Confirm before committing with: 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| ); | ||||||||||||||||||
| } else { | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -608,20 +608,16 @@ public function render_csv_button($args): void { | |
|
|
||
| $data_strings = wp_json_encode($args['data']); | ||
|
|
||
| $html = '<div class="wu-bg-gray-100 wu-p-2 wu-text-right wu-border-0 wu-border-b wu-border-solid wu-border-gray-400"> | ||
| printf( | ||
| '<div class="wu-bg-gray-100 wu-p-2 wu-text-right wu-border-0 wu-border-b wu-border-solid wu-border-gray-400"> | ||
| <a href="#" attr-slug-csv="%2$s" class="wu-export-button wu-no-underline wu-text-gray-800 wu-text-xs"> | ||
| <span class="dashicons-wu-download wu-mr-1"></span> %1$s | ||
| </a> | ||
| <input type="hidden" id="csv_headers_%2$s" value="%3$s" /> | ||
| <input type="hidden" id="csv_data_%2$s" value="%4$s" /> | ||
| <input type="hidden" id="csv_action_%2$s" value="%5$s" /> | ||
| </div>'; | ||
|
|
||
| $html = apply_filters('wu_export_html_render', $html, $html); | ||
|
|
||
| printf( | ||
| $html, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | ||
| apply_filters('wu_export_data_table_label', esc_html__('CSV', 'multisite-ultimate')), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | ||
| </div>', | ||
| esc_html__('CSV', 'multisite-ultimate'), | ||
| esc_attr($slug), | ||
|
Comment on lines
+611
to
621
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainUse data- attributes and keep label filter for backward compatibility.* Custom attributes should be data-* per HTML5. Also, hard-coding the label drops the prior customization point. Apply this diff: - printf(
- '<div class="wu-bg-gray-100 wu-p-2 wu-text-right wu-border-0 wu-border-b wu-border-solid wu-border-gray-400">
- <a href="#" attr-slug-csv="%2$s" class="wu-export-button wu-no-underline wu-text-gray-800 wu-text-xs">
- <span class="dashicons-wu-download wu-mr-1"></span> %1$s
+ printf(
+ '<div class="wu-bg-gray-100 wu-p-2 wu-text-right wu-border-0 wu-border-b wu-border-solid wu-border-gray-400">
+ <a href="#" data-slug-csv="%2$s" class="wu-export-button wu-no-underline wu-text-gray-800 wu-text-xs">
+ <span class="dashicons-wu-download wu-mr-1"></span> %1$s
</a>
<input type="hidden" id="csv_headers_%2$s" value="%3$s" />
<input type="hidden" id="csv_data_%2$s" value="%4$s" />
<input type="hidden" id="csv_action_%2$s" value="%5$s" />
</div>',
- esc_html__('CSV', 'multisite-ultimate'),
+ esc_html(apply_filters('wu_export_data_table_label', __('CSV', 'multisite-ultimate'))),
esc_attr($slug),
esc_attr($header_strings),
esc_attr($data_strings),
esc_attr($args['action'])
);If JS reads the old attribute, update it: 🏁 Script executed: #!/bin/bash
# Update JS to read data-slug-csv instead of attr-slug-csv
rg -n 'attr-slug-csv'Length of output: 4278 Use HTML5 data-attributes and enable CSV label filtering
🤖 Prompt for AI Agents |
||
| esc_attr($header_strings), | ||
| esc_attr($data_strings), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -401,8 +401,8 @@ protected function add_list_table_widget($id, $atts = []) { | |
| $atts, | ||
| [ | ||
| 'widget_id' => $id, | ||
| 'before' => '', | ||
| 'after' => '', | ||
| 'before' => fn() => null, | ||
| 'after' => fn() => null, | ||
| 'title' => __('List Table', 'multisite-ultimate'), | ||
|
Comment on lines
+404
to
406
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential fatal: defaulting 'before'/'after' to Closures may break templates expecting strings. If widget-list-table template echoes these keys, echoing a Closure triggers “Object of class Closure could not be converted to string.” Either revert defaults to strings, or ensure templates treat them as callable-or-string. Minimal safe fix (consistent with other methods in this class): - 'before' => fn() => null,
- 'after' => fn() => null,
+ 'before' => '',
+ 'after' => '',Alternatively, normalize just before rendering: $before = $atts['before'];
$after = $atts['after'];
$render = static fn($seg) => is_callable($seg) ? $seg() : print $seg;
...
// in the meta box callback, use $render($before); ... $render($after);🤖 Prompt for AI Agents |
||
| 'position' => 'advanced', | ||
| 'screen' => get_current_screen(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid value for border-collapse; browsers will ignore this.
border-collapse: 1px;is not valid CSS. Usecollapse(and addborder-spacing: 0;for completeness). Otherwise you’ll get separated borders and inconsistent rendering across HTML-to-PDF engines.Apply this diff:
.invoice-box table { - border-collapse: 1px; + border-collapse: collapse; + border-spacing: 0; }📝 Committable suggestion
🤖 Prompt for AI Agents