Make suggestion when autoload resolves to true
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Tìm PHPCS sniff và các test xử lý add_option() và update_option(); kiểm tra cách các đối số bị bỏ qua, các giá trị yes/no literal và các giá trị boolean được phân loại. Được xem là hoàn tất khi các trường hợp yes/true/implied được liệt kê tạo ra cảnh báo, các trường hợp no/false không tạo ra cảnh báo và cảnh báo có thể tham chiếu đến tài liệu autoloading được cung cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What problem would the enhancement address for VIP?
Options get marked as autoload=yes when being added, unless there is an explicit setting to no.
For VIP clients, we should flag when it is yes, to remind and encourage developers to consider whether it should be autoload=no, which can help with performance.
Describe the solution you'd like
PHPCS Warning when 'yes' or true is supplied or implied when calling add_option() or update_option().
What code should be reported as a violation?
add_option( 'my_option', 'my_value', '', 'yes' );
add_option( 'my_option', 'my_value', '', true ); // Can be 'yes' string or boolean.
add_option( 'my_option', 'my_value', '' );
add_option( 'my_option', 'my_value' );
add_option( 'my_option' );
update_option( 'my_option', 'my_value', 'yes' );
update_option( 'my_option', 'my_value', true ); // Can be 'yes' string or boolean.
What code should not be reported as a violation?
add_option( 'my_option', 'my_value', '', 'no' );
add_option( 'my_option', 'my_value', '', false );
update_option( 'my_option', 'my_value', 'no' );
update_option( 'my_option', 'my_value', false );
Additional context
Some items may indeed be valid to be autoloaded, so it's not an Error in all cases.
This may seem like a bit of noise for some cases, but I think it counts as a good reminder. We can link the error message to our public docs about autoloading.
- Ngôn ngữ chính
- PHP
- Star
- 261
- Fork
- 44
- Merge trung bình
- 3 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Automattic/VIP-Coding-Standards
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Breaking Change Type: Maintenance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Automattic/VIP-Coding-Standards#849 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
WordPress.WP.AlternativeFunctions.file_system_operations error messages cannot be fixed anymoreĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Status: Awaiting feedback
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Automattic/VIP-Coding-Standards#754 · 3 bình luận ·
Tất cả issue của Automattic/VIP-Coding-Standards
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
humanmade/publication-checklist#73 · 1 bình luận ·
-
Do not throw `WordPress.Security.EscapeOutput.OutputNotEscaped` on `apply_shortcodes()`Có thể đã có người làm @tbradsha đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
fe: spell out "Auto increment" in the table editor, "AI" reads as artificial intelligence todayĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
landsman/adminer-desktop#120 ·
Maintainer thường phản hồi trong vòng 1 ngày