You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues found upon commencement of repo usage with the WPForms plugins.
Current Behavior
Wrong counting of nested @param tags (screenshot). Fixed in 449b1e2.
Improperly claim WPForms.Comments.PHPDocHooks.RequiredHookDocumentation (screenshot1). Fixed in 56a6c5d.
WPForms.Comments.PHPDocDefine.MissPHPDoc reported on test files, what is not expected
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.
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.
Hook names should start with FQCN + method name. Currently, we validate only by FQCN.
Endless loop in ParamTagHooksSniff::countArguments. Fixed in 51d941e.
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.
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.
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_
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.
Expected Behavior
There are several issues found upon commencement of repo usage with the WPForms plugins.
Current Behavior
@paramtags (screenshot). Fixed in 449b1e2.WPForms.Comments.PHPDocHooks.RequiredHookDocumentation(screenshot1). Fixed in 56a6c5d.Remove unneeded use statement(WPForms.PHP.UseStatement.UnusedUseStatement) is wrong when class is used in PHPDoc only. The problem was in ignoring@returnstatements.Hooks can only be added in thehooksmethodon wp-content/plugins/wpforms/includes/admin/builder/class-builder.php:92 is repeated several times in CLI mode.@runInSeparateProcessin tests. Fixed in 05eb439.multi_domainssetting to the phpcs.xml blocks detection of theWordPress.Security.NonceVerification.Recommended, For instance, inwp-content/plugins/wpforms/wpforms.php:217. Fixed by a commit above.phpcs: WPForms.PHP.ValidateDomain.InvalidDomain: You are using invalid domain name. Use wpforms instead of wpforms-liteappears on many files. Fixed in d973e79.Remove unneededusestatement (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.phpcs: WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement: Remove empty line before return statement in xxx line.occurs whenifcontains a comment line and the return statement only. Fixed in 3130c0c.@paramtag counting when a hook has no arguments. Fixed in 449b1e2.wpforms/includes/class-frontend.phpthe statementapply_filters( 'wpforms_amp_pro', wpforms()->is_pro() )requires 3@paramtags. - Fixed in 72bbd67.\WPFormsSurveys\Loader::initwe improperly claimWPForms.PHP.BackSlash.UseShortSyntax. Fixed in 66dd8ef.@paramtags.. Fixed in 56a6c5d.phpcs: WPForms.Formatting.Switch.AddEmptyLineBefore: You should add an empty line beforeon wp-content/plugins/wpforms/includes/admin/builder/functions.php:106 looks like incomplete message.apply_filters_deprecatedanddo_action_deprecatedfunctions./** This filter(action) is documented in path/to/file */wpform_addon_name. Fixed in d64997f.WPForms\LongNameSpacePart\LongClassName->wpforms_long_name_space_part_long_class_name_WPForms\Providers\Provides->wpforms_providers_<property name="wp-mail-smtp" value="." />does not work. Fixed in 6ee0896.