Skip to content

Fix linter errors for ./facebook-commerce.php#3251

Closed
ajello-meta wants to merge 2 commits intomainfrom
phpcs-facebook-commerce
Closed

Fix linter errors for ./facebook-commerce.php#3251
ajello-meta wants to merge 2 commits intomainfrom
phpcs-facebook-commerce

Conversation

@ajello-meta
Copy link
Copy Markdown
Contributor

Description

This PR fixes phpcs issues in ./facebook-commerce.php. Comments were also added for several functions. The fixes were made manually (in conjunction with ./vendor/bin/phpcbf) to ensure that the logic remains the same. Running ./vendor/bin/phpcs:

[FILE: /Users/angeloou/Local Sites/test-site-i/app/public/wp-content/plugins/facebook-for-woocommerce/facebook-commerce.php](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[FOUND 126 ERRORS AND 22 WARNINGS AFFECTING 121 LINES](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
    1 | ERROR   | [ ] There must be no blank lines before the file comment (Squiz.Commenting.FileComment.SpacingAfterOpen)
   28 | ERROR   | [ ] Missing doc comment for class WC_Facebookcommerce_Integration (Squiz.Commenting.ClassComment.Missing)
 [ 184 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 185 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 186 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
  258 | ERROR   | [x] Space after opening control structure is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterStructureOpen)
  258 | ERROR   | [x] No space before opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis)
  258 | ERROR   | [x] No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis)
  258 | ERROR   | [x] Expected 1 space after IF keyword; 0 found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword)
  258 | ERROR   | [x] Expected 1 space before "!"; 0 found (WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore)
  258 | ERROR   | [x] Expected 1 space after "!"; 0 found (WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter)
  258 | ERROR   | [x] No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis)
  259 | ERROR   | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
  259 | ERROR   | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
 [ 272 | WARNING | [x] Found precision alignment of 1 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 273 | WARNING | [x] Found precision alignment of 1 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 448 | WARNING | [x] Found precision alignment of 2 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 448 | WARNING | [x] Loose comparisons are not allowed. Expected: "!=="; Found: "!=" (Universal.Operators.StrictComparisons.LooseNotEqual)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
  478 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
  490 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 [ 568 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
  577 | ERROR   | [x] Expected 25 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
  582 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 [ 589 | WARNING | [ ] Variable assignment found within a condition. Did you mean to do a comparison ? (Generic.CodeAnalysis.AssignmentInCondition.Found)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
  589 | ERROR   | [ ] Assignments must be the first block of code on a line (Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure)
 [ 590 | WARNING | [ ] Variable assignment found within a condition. Did you mean to do a comparison ? (Generic.CodeAnalysis.AssignmentInCondition.Found)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
  590 | ERROR   | [ ] Assignments must be the first block of code on a line (Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure)
 [ 635 | WARNING | [ ] Variable assignment found within a condition. Did you mean to do a comparison ? (Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 [ 717 | WARNING | [ ] In footer ($in_footer) is not set explicitly wp_enqueue_script; It is recommended to load scripts in the footer. Please set this value to `true` to load it in the](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
      |         |     footer, or explicitly `false` if it should be loaded in the header. (WordPress.WP.EnqueuedResourceParameters.NotInFooter)
  803 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
  822 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
  857 | ERROR   | [x] Space after opening control structure is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterStructureOpen)
  857 | ERROR   | [x] No space before opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis)
  857 | ERROR   | [x] Expected 1 space after IF keyword; 0 found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword)
  951 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
  958 | ERROR   | [ ] $_POST[self::FB_PRODUCT_DESCRIPTION] not unslashed before sanitization. Use wp_unslash() or similar (WordPress.Security.ValidatedSanitizedInput.MissingUnslash)
  958 | ERROR   | [ ] Detected usage of a non-sanitized input variable: $_POST[self::FB_PRODUCT_DESCRIPTION] (WordPress.Security.ValidatedSanitizedInput.InputNotSanitized)
 1020 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1053 | ERROR   | [x] Expected 3 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1054 | ERROR   | [x] Expected 3 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1059 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1089 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1104 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1118 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1138 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1140 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 1187 | ERROR   | [x] Expected 8 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1206 | ERROR   | [x] Expected 22 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1249 | ERROR   | [x] Expected 22 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1288 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1303 | ERROR   | [x] Expected 9 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1303 | ERROR   | [ ] Superfluous parameter comment (Squiz.Commenting.FunctionComment.ExtraParamComment)
 1307 | ERROR   | [x] Expected 1 spaces before closing parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose)
 1314 | ERROR   | [x] Expected 14 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1315 | ERROR   | [x] Expected 16 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1315 | ERROR   | [ ] Superfluous parameter comment (Squiz.Commenting.FunctionComment.ExtraParamComment)
[ 1320 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 1420 | ERROR   | [x] Expected 14 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1421 | ERROR   | [x] Expected 1 space after asterisk; 0 found (Squiz.Commenting.DocCommentAlignment.NoSpaceAfterStar)
 1480 | ERROR   | [x] Expected 14 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1488 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
[ 1512 | WARNING | [ ] Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 1563 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1579 | ERROR   | [x] Expected 14 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1611 | ERROR   | [x] Expected 14 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1646 | ERROR   | [x] Expected 3 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 1647 | ERROR   | [x] Expected 1 space after asterisk; 0 found (Squiz.Commenting.DocCommentAlignment.NoSpaceAfterStar)
 1649 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1681 | ERROR   | [ ] Comment missing for @throws tag in function comment (Squiz.Commenting.FunctionComment.EmptyThrows)
 1682 | ERROR   | [ ] Comment missing for @throws tag in function comment (Squiz.Commenting.FunctionComment.EmptyThrows)
 1734 | ERROR   | [ ] String concat is not required here; use a single string instead (Generic.Strings.UnnecessaryStringConcat.Found)
[ 1751 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[ 1802 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 1814 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 1920 | ERROR   | [x] Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket)
 1920 | ERROR   | [x] Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments)
 1921 | ERROR   | [x] Array item not aligned correctly; expected 12 spaces but found 16 (WordPress.Arrays.ArrayIndentation.ItemNotAligned)
 1922 | ERROR   | [x] Array item not aligned correctly; expected 12 spaces but found 16 (WordPress.Arrays.ArrayIndentation.ItemNotAligned)
 1922 | ERROR   | [x] There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine)
 1923 | ERROR   | [x] Multi-line function call not indented correctly; expected 8 spaces but found 12 (PEAR.Functions.FunctionCallSignature.Indent)
 1923 | ERROR   | [x] Array closer not aligned correctly; expected 8 space(s) but found 12 (WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned)
 1923 | ERROR   | [x] Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments)
 1923 | ERROR   | [x] Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine)
 1950 | ERROR   | [x] Expected 6 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
[ 2012 | WARNING | [ ] strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead. (WordPress.WP.AlternativeFunctions.strip_tags_strip_tags)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[ 2015 | WARNING | [ ] strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead. (WordPress.WP.AlternativeFunctions.strip_tags_strip_tags)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[ 2028 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 2210 | ERROR   | [ ] Expected 1 @throws tag(s) in function comment; 2 found (Squiz.Commenting.FunctionCommentThrowTag.WrongNumber)
 2348 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2363 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2373 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2388 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2398 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2413 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2423 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2438 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2448 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2452 | ERROR   | [ ] Using short ternaries is not allowed as they are rarely used correctly (Universal.Operators.DisallowShortTernary.Found)
 2463 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2473 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2488 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2498 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2508 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2518 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2528 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2538 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2548 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2558 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2568 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2582 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2596 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2610 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2624 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2638 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2642 | ERROR   | [ ] Using short ternaries is not allowed as they are rarely used correctly (Universal.Operators.DisallowShortTernary.Found)
 2644 | ERROR   | [ ] Using short ternaries is not allowed as they are rarely used correctly (Universal.Operators.DisallowShortTernary.Found)
 2654 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2669 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2680 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2691 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2701 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2711 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2721 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2751 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2762 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2772 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2782 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2804 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 2828 | ERROR   | [ ] All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$message'.
      |         |     (WordPress.Security.EscapeOutput.OutputNotEscaped)
 2888 | ERROR   | [ ] All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
      |         |     (WordPress.Security.EscapeOutput.OutputNotEscaped)
 2934 | ERROR   | [x] Expected 9 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 2949 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 2996 | ERROR   | [x] Additional blank lines found at end of doc comment (Generic.Commenting.DocComment.SpacingAfter)
 3006 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 3019 | ERROR   | [x] Expected 19 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
 3020 | ERROR   | [x] Expected 22 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
[ 3046 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 3046 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
[ 3052 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 3052 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
 3085 | ERROR   | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
[ 3096 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
 3115 | ERROR   | [x] The closing brace for the class must go on the next line after the body (PSR2.Classes.ClassDeclaration.CloseBraceAfterBody)
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[PHPCBF CAN FIX THE 105 MARKED SNIFF VIOLATIONS AUTOMATICALLY](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------](https://woo2.staging.magento-commerce-extension-testing.com/wp-admin/)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected

Test Plan

  1. Run ./vendor/bin/phpcs, you should get:
FILE: /Users/angeloou/Local Sites/test-site-i/app/public/wp-content/plugins/facebook-for-woocommerce/facebook-commerce.php
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  570 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
  638 | WARNING | Variable assignment found within a condition. Did you mean to do a comparison ? (Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition)
  720 | WARNING | In footer ($in_footer) is not set explicitly wp_enqueue_script; It is recommended to load scripts in the footer. Please set this value to `true` to load it in the footer,
      |         | or explicitly `false` if it should be loaded in the header. (WordPress.WP.EnqueuedResourceParameters.NotInFooter)
 1504 | WARNING | Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)
 1740 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
 1791 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
 2004 | WARNING | strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead. (WordPress.WP.AlternativeFunctions.strip_tags_strip_tags)
 2007 | WARNING | strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead. (WordPress.WP.AlternativeFunctions.strip_tags_strip_tags)
 2020 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
 3055 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1. Run extension and test the basic functionality to ensure everything still works as intended.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ajello-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2025

📦 Latest Plugin Build

Built at: 2025-05-28T23:31:38.769Z
Commit: 3c11b2b
Size: 1.1M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ajello-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ajello-meta merged this pull request in 450199e.

@carterbuce carterbuce mentioned this pull request May 29, 2025
@tzahgr tzahgr mentioned this pull request Jun 4, 2025
facebook-github-bot pushed a commit that referenced this pull request Jun 4, 2025
Summary:
= 3.5.0 - 2025-05-28 =
*  Add - Create basic checkout permalink w/ products and coupon support by ajello-meta in #2887
*  Add - Common Feed Upload Framework by Jmencab in #2875
*  Fix - Fix bug where templates were not loading correctly by ajello-meta in #2915
*  Tweak - Change MICE to use base site url instead of shop url by carterbuce in #2934
*  Tweak - Improve custom checkout UI by ajello-meta in #2930
*  Tweak - Make custom checkout UI mobile compatible by ajello-meta in #2942
*  Fix - Update parsing for Checkout URL Product IDs by carterbuce in #2935
*  Add - Implement dummy logging util by nealweiMeta in #2920
*  Add - Setup cron job for batch logging with global message queue by nealweiMeta in #2924
*  Add - Error log request api activate by nealweiMeta in #2933
*  Add - Log locally with debug mode enabled by nealweiMeta in #2939
*  Add - Ratings and reviews feed upload by nrostrow-meta in #2937
*  Tweak - Feed upload skip logic and logging calls by nrostrow-meta in #2964
*  Add - Add function to fetch feed upload instance by nrostrow-meta in #2970
*  Tweak - Have feed uploads always use feed generator by nrostrow-meta in #2971
*  Tweak - Trigger metadata feed uploads on CPI ID change (post onboarding) by nrostrow-meta in #2995
*  Add - Shipping profile feed upload button by nrostrow-meta in #3140
*  Add - Navigation menu feed upload logic by nrostrow-meta in #3159
*  Fix - Fixing some fclose and logging gaps in the feed upload logic by nrostrow-meta in #3192
*  Add - Enabling navigation menu feed upload and adding manual sync button by nrostrow-meta in #3223
*  Add - Promotions feed upload by carterbuce in #2941
*  Add - Plugin AJAX API Framework by sol-loup in #2928
*  Tweak - Test Infrastructure Enhancement by sol-loup in #2944
*  Add - Implement telemetry logs api by nealweiMeta in #2940
*  Fix -  Make error logging event configurable by nealweiMeta in #2954
*  Add - Implement logging toggle by nealweiMeta in #2959
*  Fix - auto products sync by nealweiMeta in #2978
*  Tweak - Sync products with restriction by nealweiMeta in #2983
*  Fix - Fix use_enhanced_onboarding for legacy connections by carterbuce in #2986
*  Add - Create enhanced settings UI by ajello-meta in #2968
*  Add - Create new troubleshooting drawer from legacy debug settings by ajello-meta in #2977
*  Add - Add manual product and coupon sync buttons by ajello-meta in #2984
*  Tweak - Make page title in enhanced settings static by ajello-meta in #2985
*  Tweak - Align finalized content for logging toggle by nealweiMeta in #2992
*  Tweak - Improve local log by nealweiMeta in #3009
*  Fix - Fix free shipping coupon sync by carterbuce in #2993
*  Tweak - Add logging for feed generation scheduling failure by carterbuce in #2994
*  Tweak - Add logging in checkout for coupon code by ajello-meta in #2991
*  Tweak - Clean up CSS in enhanced settings UI by ajello-meta in #2996
*  Tweak - Remove the "Advertise" tab by ajello-meta in #3024
*  Tweak - Sync "Usage Count" in Promos Feed by carterbuce in #3036
*  Tweak - Disable mini_shops product capability for unsupported items by carterbuce in #3084
*  Add - Add usage logging for enhanced settings tabs by ajello-meta in #3202
*  Tweak - Remove UI of a checkbox that controls enablement of the new style feed generation by mshymon in #3056
*  Fix - Fix linter errors for ./includes/fbutils.php files by ajello-meta in #3075
*  Fix - Hotfix for Rollout Switches by vinkmeta in #3236
*  Add - Opt out sync experience. by SayanPandey in #3220
*  Fix - Added a transient flag to avoid flooding of product set api requests by vinkmeta in #3245
*  Fix - Additional check for the opt-out banner by SayanPandey in #3259
*  Fix - Bump up GraphAPI version to 21 by vahidkay-meta in #3219
*  Fix - fix linter errors for ./class-wc-facebookcommerce.php by ajello-meta in #3255
*  Fix - fix linter errors for ./facebook-commerce-events-tracker.php by ajello-meta in #3254
*  Fix - fix linter errors for ./includes/Admin/Settings_Screens/Advertise.php by ajello-meta in #3237
*  Fix - fix linter errors for ./includes/Admin/Settings_Screens/Product_Sync.php by ajello-meta in #3239
*  Fix - fix function return typing for get_settings() by ajello-meta in #3257
*  Tweak - Addition check for opt out by SayanPandey in #3259
*  Tweak - Update the GraphAPI version to 21 by vahidkay-meta in #3219
*  Fix - Enabled rollout switch only for plugin admins by vinkmeta in #3242
*  Add - reset connection functionality by jczhuoMeta in #3262
*  Fix - fixing the non static method called as static issue by SayanPandey in #3263
*  Fix - Fix linter errors for ./facebook-commerce.php by ajello-meta in #3251

Pull Request resolved: #3264

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

**!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!**
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V7
https://internalfb.com/intern/testinfra/testrun/10414574226197703
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V7
https://internalfb.com/intern/testinfra/testrun/844425351364266

Reviewed By: vinkmeta, nrostrow-meta

Differential Revision: D75569981

Pulled By: carterbuce

fbshipit-source-id: 11bb39a9d66dfcbc80af413466feef0792d27ce4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants