Commit graph

25 commits

Author SHA1 Message Date
Rua Haszard
7bd2171866
reinstate phpcs php linting (#1463)
* update squizlabs/php_codesniffer and WP coding standards to latest

* revamp phpcs sniffer rulesets:
- update to php-compatibility (wimg is defunct)
- add version for woocommerce-sniffs

* streamline phpcs config (get it working at all):
- update min WP version to 5.3
- remove references to rules we don't have installed
  - WordPress.VIP
  - WordPress.XSS

* fix 2x phpcs errors (automatically via phpcbf)

* update phps ignore unescaped output comment to current format

* add npm scripts for php linter and linter autofixer

* auto-fix PHP linter errors using phpcbf :

Before phpcbf:

[x] PEAR      Functions           Function call signature multiple arguments          127
[x] Generic   White space         Disallow space indent spaces used                   10
[ ] WordPres  WP                  Enqueued resource parameters missing version        6
[ ] PHPCompa  Language construct  New language constructs t_ns_separator found        4
[ ] WordPres  Security            Escape output output not escaped                    4
[ ] PHPCompa  Parameter values    New HTMLEntities encoding default not set           2
[ ] WordPres  Date time           Restricted functions date_date                      2
[x] Generic   Files               End file newline not found                          1
[x] PEAR      Functions           Function call signature close bracket line          1
[x] PEAR      Functions           Function call signature content after open bracket  1
[x] Squiz     White space         Superfluous whitespace end line                     1
[x] WordPres  Arrays              Comma after array item no comma                     1

phpcbf fixed all [x] violations, all whitespace/formatting

After phpcbf:

WordPres  WP                  Enqueued resource parameters missing version      6
PHPCompa  Language construct  New language constructs t_ns_separator found      4
WordPres  Security            Escape output output not escaped                  4
PHPCompa  Parameter values    New HTMLEntities encoding default not set         2
WordPres  Date time           Restricted functions date_date                    2

Note - this commit does not include auto-fixed files with other
violations. These will follow in separate commit (after fixing!)

* fix phpcs violations:
- numerous formatting issues fixed automatically
- manually fix missing version param in calls to wp_enqueue_style

* fix phpcs violations:
- numerous formatting issues fixed automatically
- fix missing deps param in call to wp_enqueue_style

* update phpcs test php version to match min requirement (5.6)

* fix phpcs violations including some missing escaping:
- numerous formatting issues fixed automatically
- prefer gmdate() over potentially ambiguous date()
- escape output (a real issue!) of comment dates

* fix violations (all automated formatting fixes)

* reinstate WordPress rule/standard in phpcs.xml (minimise PR changes)

* exclude build (pre-zip) ./storefront & tighten excludes for dep folders

* bulk-update Security.EscapeOutput.OutputNotEscaped ignore comment:
- the previous comment format is no longer supported
- bulk replacing these to reduce phpcs warning overhead
2020-09-21 15:50:46 +01:00
Tiago Noronha
aca53ea792 Fix Query Monitor missing dependency warning 2019-05-13 10:42:15 +03:00
Tiago Noronha
7ae12331eb Split Jetpack styles into separate files 2019-03-07 17:28:29 +00:00
Tiago Noronha
62e2eeb9cd Add missing WC functions file include 2018-12-10 12:12:42 +00:00
Tiago Noronha
169c21e35a Fix PHPCS violations 2018-06-22 15:11:39 +01:00
Tiago Noronha
2bdcb08d00 Remove @author tag 2018-06-20 09:58:39 +01:00
Tiago Noronha
18a966db26 Update author from WooThemes to Automattic 2018-06-05 11:02:45 +01:00
Tiago Noronha
072d5df073 Remove unused global 2018-03-22 14:48:22 +00:00
Tiago Noronha
f905a159d3 Remove posts_per_page in Jetpack IS integration 2018-03-22 14:22:53 +00:00
Tiago Noronha
e89399ae05 Fix fatal error when using Jetpack infinite scroll without WooCommerce 2018-03-21 17:57:51 +00:00
Tiago Noronha
efee4c786b Remove infinite scroll duplicate products hack 2018-03-19 17:36:42 +00:00
Tiago Noronha
92cd18d70b Fix current page in infinite scroll 2018-03-12 17:51:03 +00:00
Tiago Noronha
5b1fbeb6fd Jetpack infinite scroll compatibility with WC 3.3 2018-03-12 17:15:52 +00:00
Tiago Noronha
f23e14293a Organize CSS folder and remove sass on deploy 2018-02-08 18:29:45 +00:00
Tiago Noronha
d84017ca4a Remove hardcoded Jetpack infinite scroll setting. 2018-01-02 18:05:54 +00:00
Tiago Noronha
5c0ca27201 Also filter jetpack infinite scroll offset in product archives. #634 2017-08-02 18:20:27 +01:00
Tiago Noronha
177aa3cce3 Hook column wrappers into inifite scroll actions 2017-05-16 11:55:44 +01:00
James Koster
dc6e5a4995 Fix duplicated product display with jetpack infinite scroll. closes #563 2017-03-28 14:12:07 +01:00
James Koster
331247ca83 Add actions to the jetpack infinite scroll loop function. closes #530 2017-01-13 11:03:43 +00:00
James Koster
87d4d3a9c3 Makes Jetpack infinite scroll work with products
* Use the product template when visiting product archives.
* Hide pagination elements when infinite scrolling.
* Specify footer widget regions, posts per page default and type
default.
* Adds `storefront_jetpack_infinite_scroll_args` for child themes /
plugins.
* Adds `storefront_is_product_archive()`.
2016-10-17 11:45:25 +01:00
Tiago Noronha
a921ad3a54 Remove irrelevant conditional logic on custom jetpack styles 2016-09-01 16:54:35 +02:00
alaczek
a3146bc81f Fix path to the jetpack.css file. 2016-04-05 12:03:00 +02:00
James Koster
1409ee5c66 lots of coding standards tweaks. #326 2016-02-19 16:57:56 +00:00
James Koster
97eebe0924 A large code cleanup and sets $storefront_version as a global var
* Strip spaces
* more efficient syntax
* Coding standards compliance
2016-02-04 13:16:31 +00:00
James Koster
7bb9c30d8f file restructuring 2016-01-21 13:50:52 +00:00
Renamed from inc/class-storefront-jetpack.php (Browse further)