Skip to content
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

Known issues #19

Open
29 of 36 tasks
kagg-design opened this issue Dec 16, 2021 · 1 comment
Open
29 of 36 tasks

Known issues #19

kagg-design opened this issue Dec 16, 2021 · 1 comment
Labels

Comments

@kagg-design
Copy link
Contributor

kagg-design commented Dec 16, 2021

Expected Behavior

There are several issues found upon commencement of repo usage with the WPForms plugins.

Current Behavior

  • Endless loop in ParamTagHooksSniff::countArguments. Fixed in 51d941e.
  • Relative path detection in PhpStorm temporary folder. Fixed in Fix relative path detection in PhpStorm temporary folder. #18.
  • Do not scan vendor folders in plugins. Fixed in 133a6fe.
  • Fix determining the fully qualified class name (FQCN) to validate hook name. We determined the FQCN from the file path, which doesn't work at all for classes not following the PSR-4 standard. I have created the FQCN extraction from analyzed file tokens. Fixed in f7eb077.
  • Reduce usage of @runInSeparateProcess in tests. Fixed in 05eb439.
  • Validation of the text domain has some issues: when the domain is not specified, last argument of the i18n function is not a string, i18n function contains nested parenthesis. Fixed in a59d5f5.
  • In hook expected names, convert class name from CamelCase to snake_case. Fixed in c60c67b.
  • Cannot detect the hook name when a hook is not a constant string. Fixed in ea81caf and d2300f2.
  • Allow the presence of comments inside the first argument (hook name). Fixed in 0f5577b.
  • Adding of the multi_domains setting to the phpcs.xml blocks detection of the WordPress.Security.NonceVerification.Recommended, For instance, in wp-content/plugins/wpforms/wpforms.php:217. Fixed by a commit above.
  • Message phpcs: WPForms.PHP.ValidateDomain.InvalidDomain: You are using invalid domain name. Use wpforms instead of wpforms-lite appears on many files. Fixed in d973e79.
  • Message Remove unneeded use statement (WPForms.PHP.UseStatement.UnusedUseStatement) is wrong when class is used in PHPDoc only. See TestCase,php as an example. The problem was in ignoring @throws statements. Fixed in 389b559.
  • Message phpcs: WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement: Remove empty line before return statement in xxx line. occurs when if contains a comment line and the return statement only. Fixed in 3130c0c.
  • Endless loop in SinceTagHooksSniff.php. Fixed in e212b30.
  • Wrong detection of the text domain by the property in the ruleset. Fixed in 9ae857b.
  • Prevent endless loop in HooksMethoidSniff.php. Fixed in a055581.
  • Do not use HooksMethodSniff.php when not in the class file. Fixed in e7dcf55.
  • Fix wrong @param tag counting when a hook has no arguments. Fixed in 449b1e2.
  • In wpforms/includes/class-frontend.php the statement apply_filters( 'wpforms_amp_pro', wpforms()->is_pro() ) requires 3 @param tags. - Fixed in 72bbd67.
  • In \WPFormsSurveys\Loader::init we improperly claim WPForms.PHP.BackSlash.UseShortSyntax. Fixed in 66dd8ef.
  • Respect /** This action/filter is documented in... */ and do not count @param tags.. Fixed in 56a6c5d.
  • Wrong counting of nested @param tags (screenshot)
  • Improperly claim WPForms.Comments.PHPDocHooks.RequiredHookDocumentation (screenshot1, screenshot2)
  • WPForms.Comments.PHPDocDefine.MissPHPDoc reported on test files, what is not expected
  • When @param uses [], like WP_Post[], the alignment error ParamTagHooks.InvalidAlign occurs
  • phpcs: WPForms.Formatting.Switch.AddEmptyLineBefore: You should add an empty line before on wp-content/plugins/wpforms/includes/admin/builder/functions.php:106 looks like incomplete message.
  • Hooks can only be added in the hooks method on wp-content/plugins/wpforms/includes/admin/builder/class-builder.php:92 is repeated several times in CLI mode.
  • Incorrectly calculating hook's arguments for the apply_filters_deprecated and do_action_deprecated functions.
  • Shouldn't be errors related to the Hooks Documentation when a hook has a comment /** This filter(action) is documented in path/to/file */
  • Hooks in addons should start with wpform_addon_name. Fixed in d64997f.
  • All namespace parts consisting of two or more words in hook names should be converted to snake case and has underscore symbol between words: e.g. WPForms\LongNameSpacePart\LongClassName -> wpforms_long_name_space_part_long_class_name_
  • If a namespace part the same as a class name we should collapse them: e.g. WPForms\Providers\Provides -> wpforms_providers_
  • Message Remove unneeded use statement (WPForms.PHP.UseStatement.UnusedUseStatement) is wrong when class is used in PHPDoc only. The problem was in ignoring @return statements.
  • Cannot define text domain in the same directory where phpcs.xml is located. So, <property name="wp-mail-smtp" value="." /> does not work. Fixed in 6ee0896.
  • Show an error if the i18n function doesn't have a domain at all.
  • Hook names should start with FQCN + method name. Currently, we validate only by FQCN.
@slaFFik
Copy link
Member

slaFFik commented Dec 17, 2023

@kagg-design I would suggest making each individual unchecked checkbox as a separate GH issue. This way it will be easier to have relevant conversations separate plus easier to reference completed issues in commits.

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

No branches or pull requests

2 participants