Skip to:
Content

BuddyPress.org

Opened 2 years ago

Last modified 5 days ago

#9174 assigned task

WPCS improvements for 15.0

Reported by: espellcaste Owned by: espellcaste
Priority: normal Milestone: 15.0.0
Component: Core Version:
Severity: normal Keywords: has-patch
Cc:

Description

Previously:

Change History (57)

#1 @espellcaste
2 years ago

  • Summary WPCS Improvements for 15.0WPCS improvements for 15.0

#2 @johnjamesjacoby
2 years ago

In 13927:

WPCS: param & global docs corrections.

Some were missing, out-of-order, or potentially wrong based on conditional logic (I.E. when specific class names are juggled based on Site/Network admin area contexts). For those, I opted just to use "object" rather than the exact class names, because they're lengthy & ugly & make the docs more difficult to read. Feel free to override that decision later!

See: #9174.

#3 @espellcaste
2 years ago

For those, I opted just to use "object" rather than the exact class names, because they're lengthy & ugly & make the docs more difficult to read. Feel free to override that decision later!

I'm not opposed to this change but two arguments for adding the object class is IDE support (intelephense) and it makes more clearer about its value.

In a IDE, like vscode, one can't go to that particular class anymore, since it is an anonymous object. One can't also tell what's the object real class, which properties this object support, if it does.

Essentially, one loses intelephense support, which is helpful while developing and we would be documenting the variable's true value.

If the $global value accepts both an anonymous object and BP_Optouts_List_Table, I'd advocate adding both there.

docs more difficult to read

I'd argue it makes it lenthy, not difficult to read. But I'd accept this is just my opinion.

#5 @imath
2 years ago

  • Milestone Up Next15.0.0

This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.


2 years ago

#8 @espellcaste
2 years ago

In 13968:

WPCS: Part XII: miscellaneous fixes for some of the files of the core component.

Follow-up to [13904]

See #9174 and #9173

#9 @espellcaste
2 years ago

In 13971:

WPCS: miscellaneous fixes for cache-related files in several components.

See #9174 and #9173
Closes https://github.com/buddypress/buddypress/pull/331

#10 @espellcaste
2 years ago

In 13972:

WPCS: stop some rules from being applied to the project.

This is a preliminary list that can be extended or updated afterwards.

See #9174

#11 @espellcaste
2 years ago

In 13992:

PHPDoc: Update bp_core_set_incremented_cache to better reflect the accepted value to store in the cache.

See #9174

#12 @espellcaste
2 years ago

In 14010:

WPCS: Part I: miscellaneous fixes for some of the files of the blogs component.

See #9174
See #9173

This ticket was mentioned in PR #366 on buddypress/buddypress by renatonascalves.


2 years ago
#14

Apply phpcbf to the activity component so that we can fix automatic styling issues in bulk.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/9174

This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.


2 years ago

#16 @espellcaste
2 years ago

In 14016:

WPCS: append some new rules from being applied to the project.

Follow-up from [13972].

See #9174

#17 @imath
2 years ago

In 14022:

WPCS: improve BP Nouveau's main functions file code formatting.

Props narenin

Fixes #9230
See #9174
Closes https://github.com/buddypress/buddypress/pull/372

#18 @espellcaste
22 months ago

In 14076:

WPCS - Part I: miscellaneous fixes for some of the files of the groups component.

See #9173
See #9174

#19 @espellcaste
22 months ago

In 14077:

PHPDoc - adjust @subpackage name for all components.

See #9173 and #9174.

#20 @espellcaste
22 months ago

In 14079:

Fix for an incorrect change as part of [14076]

See #9173 and #9174

#21 @espellcaste
16 months ago

In 14124:

WPCS - miscellaneous fixes for the BP Settings component.

See #9174
See #9173

#22 @espellcaste
8 months ago

In 14148:

WPCS - miscellaneous fixes to the BP_Activity_Activity class.

Props espellcaste.

See #9173
See #9174

#23 @espellcaste
8 months ago

In 14185:

Address a WPCS error for the new bp_get_blog_latest_post_id function.

Introduced at [14165].

See #9286, #9174, and #9173.

#24 @espellcaste
2 weeks ago

In 14242:

WPCS: intentional formatting and generated block assets are skipped.

  • Exclude the complete Generic.WhiteSpace.ScopeIndent sniff so PHPCBF preserves intentional nested bp_get_*() indentation.
  • Exclude generated block index.asset.php files from PHPCS and PHPCBF as whole files.

Props espellcaste.
See #9174.

#25 @espellcaste
2 weeks ago

In 14244:

WPCS: normalize function-call argument spacing.

Remove excess spaces around function-call argument commas.

Props espellcaste.
See #9174.

#26 @espellcaste
2 weeks ago

In 14246:

WPCS: Improve multiple statement alignment.

Props espellcaste.
See #9174.

#27 @espellcaste
2 weeks ago

In 14249:

WPCS: Improve horizontal whitespace.

Normalize operator spacing and replace mid-line tabs with spaces.

Props espellcaste.
See #9174.

#28 @espellcaste
2 weeks ago

In 14251:

WPCS: Improve additional whitespace formatting.

Normalize array-key, precision-alignment, concatenation, and semicolon whitespace.

Props espellcaste.
See #9174.

#29 @espellcaste
2 weeks ago

In 14253:

I18n: Clarify placeholder context for translators.

Explain what each formatted placeholder represents so translated strings can preserve the intended meaning and argument order.

Props espellcaste.
See #9174.

#30 @espellcaste
2 weeks ago

In 14254:

xProfile: Use strict matching when locating registered field types.

Field type registries contain class names as strings. Use strict array searches so unrelated values cannot be treated as matching classes.

Props espellcaste.
See #9174.

#31 @espellcaste
2 weeks ago

In 14255:

Friends: Improve function-call and array formatting.

Make multiline calls and arrays easier to read and consistently formatted.

Props espellcaste.
See #9174.

#32 @espellcaste
2 weeks ago

In 14256:

WPCS: Modernize equivalent PHP syntax.

Use __DIR__ for current-directory paths, add constructor parentheses, simplify include statements, and use single quotes for static strings.

Props espellcaste.
See #9174.

#33 @espellcaste
2 weeks ago

In 14257:

xProfile: Use strict comparisons for xProfile values.

Use strict equality and array matching for xProfile field, visibility, and query values.

Props espellcaste.
See #9174.

#34 @espellcaste
2 weeks ago

In 14258:

WPCS: Complete static-string quote normalization.

Use single quotes for the remaining static Friends SQL fragment omitted when two formatting changes overlapped.

Props espellcaste.
See #9174.

#35 @espellcaste
2 weeks ago

In 14259:

Activity: Use strict comparisons for Activity values.

Use strict equality and array matching for activity IDs, query values, notifications, and status flags.

Props espellcaste.
See #9174.

#36 @espellcaste
2 weeks ago

In 14260:

Blogs: Improve function-call and array formatting.

Make multiline calls and arrays easier to read and consistently formatted throughout the Blogs component.

Props espellcaste.
See #9174.

#37 @espellcaste
2 weeks ago

In 14261:

Notifications: Improve function-call and array formatting.

Make multiline calls and arrays easier to read and consistently formatted throughout the Notifications component.

Props espellcaste.
See #9174.

#38 @espellcaste
2 weeks ago

In 14262:

WPCS: Complete strict comparison modernization.

Use strict equality and array matching throughout the remaining components and template packs, normalizing legacy IDs, statuses, and values where needed.

Props espellcaste.
See #9174.

#39 @espellcaste
2 weeks ago

In 14263:

WPCS: Improve remaining function-call and array formatting.

Make multiline calls and arrays easier to read and consistently formatted throughout Activity, Core, Groups, Members, Messages, xProfile, and the template packs.

Props espellcaste.
See #9174.

#40 @espellcaste
2 weeks ago

In 14264:

WPCS: Improve embedded PHP formatting.

Normalize PHP tag spacing and inline statement formatting throughout components and template packs while preserving whitespace-sensitive output.

Props espellcaste.
See #9174.

#41 @espellcaste
8 days ago

In 14268:

WPCS: Improve control-structure formatting.

Normalize switch/case declarations, inline controls, control signatures, and spacing throughout components and template packs.

Props espellcaste.
See #9174.

#42 @espellcaste
8 days ago

In 14269:

WPCS: Remove generated markup suppressions.

Refactor output-sensitive template conditions and loops to satisfy control-structure rules without changing generated markup.

Props espellcaste.
See #9174.

#43 @espellcaste
8 days ago

In 14270:

WPCS: Use self for local static member references.

Replace hard-coded class names with self:: when accessing local static methods.

Props espellcaste.
See #9174.

#44 @espellcaste
8 days ago

In 14271:

WPCS: Improve whitespace and array formatting.

Normalize array syntax and spacing, casts, constants, string concatenation, indentation, and superfluous whitespace.

Props espellcaste.
See #9174.

#45 @espellcaste
8 days ago

In 14272:

WPCS: Improve comment formatting.

Normalize block comment endings, spacing, and documentation alignment.

Props espellcaste.
See #9174.

#46 @espellcaste
8 days ago

In 14273:

WPCS: Improve function and declaration formatting.

Normalize function declarations, closure layout, argument spacing, and spacing before closing braces.

Props espellcaste.
See #9174.

#47 @espellcaste
8 days ago

In 14274:

WPCS: Add explicit visibility to class members.

Replace legacy var declarations and implicit public method visibility with explicit public declarations.

Props espellcaste.
See #9174.

#48 @espellcaste
8 days ago

In 14275:

WPCS: Normalize increment and decrement operators.

Use prefix operators for standalone increments and decrements, and normalize increment spacing and grouping.

Props espellcaste.
See #9174.

#49 @espellcaste
8 days ago

In 14276:

WPCS: Improve simple control structure syntax.

Use elseif, split same-line statements, clarify boolean precedence, and flatten lone nested conditionals without changing control flow.

Props espellcaste.
See #9174.

#50 @espellcaste
8 days ago

In 14277:

WPCS: Use WordPress alternatives for JSON encoding and randomness.

Replace discouraged json_encode() and rand() calls with wp_json_encode() and wp_rand().

Props espellcaste.
See #9174.

#51 @espellcaste
6 days ago

In 14278:

WPCS: Make script placement and UTC timestamps explicit.

Preserve existing header-loading and UTC timestamp behavior while using explicit supported parameters and APIs.

Props espellcaste.
See #9174.

#52 @espellcaste
6 days ago

In 14279:

WPCS: Use snake case for local variable names.

Rename internal variables without changing public methods, properties, classes, hooks, or callback signatures.

Props espellcaste.
See #9174.

#53 @espellcaste
6 days ago

In 14280:

WPCS: Split multiple assignments into explicit statements.

Preserve right-to-left assignment order while making each assignment explicit.

Props espellcaste.
See #9174.

#54 @espellcaste
6 days ago

In 14281:

WPCS: Move simple assignments out of conditions.

Separate variable assignment from their actual conditional.

Props espellcaste.
See #9174.

#55 @espellcaste
5 days ago

In 14282:

WPCS: Exclude deferred performance and error-suppression checks.

Defer SlowDBQuery advisories and intentional silenced-call

Props espellcaste.
See #9174.

#56 @espellcaste
5 days ago

In 14283:

WPCS: Remove non-executable statements.

Remove unreachable breaks and redundant terminal returns.

Props espellcaste.
See #9174.

#57 @espellcaste
5 days ago

In 14284:

WPCS: Use supported replacements for deprecated WordPress functions.

Use modern capability and UTF-8 APIs when available while preserving fallbacks for supported WordPress versions.

Props espellcaste.
See #9174.

Note: See TracTickets for help on using tickets.