Skip to content

Code Quality Fixes #71

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

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Code Quality Fixes #71

wants to merge 28 commits into from

Conversation

apermo
Copy link

@apermo apermo commented Apr 5, 2025

This PR includes Code Style, PHPdoc and other code quality fixes.

Pushes with just phpcbf are marked as such.

Besides a few marked places not output should be altered.

apermo added 20 commits April 5, 2025 08:23
removed unused globals
fixed code style
fixed phpdoc
Copy link
Author

@apermo apermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions.

<?php printf( __( '%1$s', 'autonomie' ), $categories_list ); ?>
<?php
// translators: %1$s Category list in HTML.
printf( __( '%1$s', 'autonomie' ), $categories_list );
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfefferle Why did you use the translation here in the first place?

<?php printf( __( '%1$s', 'autonomie' ), $tags_list ); ?>
<?php
// translators: %1$s Tag list in HTML.
printf( __( '%1$s', 'autonomie' ), $tags_list );
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@apermo apermo marked this pull request as ready for review April 5, 2025 08:04
@@ -470,7 +470,7 @@ function autonomie_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="comment <?php $comment->comment_type; ?>" itemprop="comment" itemscope itemtype="https://schema.org/Comment">
<article id="comment-<?php comment_ID(); ?>" class="comment <?php echo $comment->comment_type; ?>" itemprop="comment" itemscope itemtype="https://schema.org/Comment">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfefferle Review here, this echo was missing before, please verify that this has no sideeffects, alternatively we can remove the output.

Comment on lines +34 to +39
/* translators:
%1$s: number of comments, mind to add this if your language uses singular for more than just n=1
%2$s: post title
*/
_n(
'One thought on &ldquo;%2$s&rdquo;', // phpcs:ignore WordPress.WP.I18n.MissingSingularPlaceholder -- Translator instructions added.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs: WordPress.WP.I18n.MissingSingularPlaceholder: Missing singular placeholder, needed for some languages. See https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals

The phpcs error here noted that the placeholder must be added, since slavic and some other languages have multiple singulars, I assume by adding a more precise translators comment, this should be covered.

@apermo
Copy link
Author

apermo commented Apr 5, 2025

@pfefferle I'm ready with the code style fixes and review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant