Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

535
Visualizações
WordPress Coding Standards – phpcs Warnings

I'm using the WordPress-Core rules for a project I just started in PhpStorm (involves developing a custom plugin and theme), and I find it strange that most of the default php files in a clean WordPress install (for example, wp-config.php, wp-mail.php, etc.) don't pass the phpcs test when any of the WordPress rules in that repo are used.

Most of the times I see the open and close bracket warning:

PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket

The WordPress-Core ruleset in the repo says:

<rule ref="PEAR.Functions.FunctionCallSignature">
    <properties>
        <property name="requiredSpacesAfterOpen" value="1"/>
        <property name="requiredSpacesBeforeClose" value="1"/>
    </properties>
</rule>

This makes me think that the warnings are legit(?). If this is the case, why are the WP core files not following WP's own code standards fully?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Historically, WordPress has avoided cleaning up the Core code style, for several reasons:

  • The tools for checking coding standards were not particularly reliable. This has changed in recent years, with the WordPress Coding Standards (WPCS) project maturing, and many of the little edge cases being fixed in PHPCS.
  • With no reliable automated tools, this would be a manual job, requiring many commits. This causes unnecessary code churn, and makes it harder to look through revision logs.
  • It just hasn't been a high priority. ~4% of WordPress' PHP violates the coding standard, so most folks just don't encounter it.

With the tools maturing, that position changed recently, there's now an in-progress effort to get PHPCS and WPCS working with WordPress Core. With appropriate automated testing, WordPress will continue to match it's own coding standards in the future.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda