action-scheduler icon indicating copy to clipboard operation
action-scheduler copied to clipboard

[Task] Codebase should pass linting checks

Open eddr opened this issue 2 years ago • 14 comments
trafficstars

Improve coding standards across Action Scheduler. We should pass our own linting tests, and ideally those should intersect with the WPCS checks implemented by the WooCommerce Marketplace.

  • This accommodates a scenario where a plugin wishes to be listed in the marketplace, but also functions in a standalone capacity (ie, it cannot depend on the version of Action Scheduler bundled with WooCommerce). See discussion in the comments for more context.
  • Irrespective of the above, this should result in improved code hygiene for Action Scheduler and less noise when linting locally.
  • This is probably best handled incrementally; I advise against anyone submitting a monolithic fixes-everything style PR.

Additionally, as described in issues like this one, we should aim to get Action Scheduler's code to a point where it meets the expectations of the W.org plugin review team.


Original title:

Action Scheduler shows phpcs errors using wpcs : can't submit new extension to WC marketplace

Original description:

Hi and thanks for excellent and useful plugin!

I'm facing issues when trying to submit a new extension to the WC marketplace. The plugin uses Action Scheduler library and it causes the automatic tests to not pass WC own phpcs checks

Any clue what can be done?

Thanks

eddr avatar Aug 01 '23 08:08 eddr

Internal discussion: p1690905319416299-slack-C3L7CFBRV

barryhughes avatar Aug 01 '23 16:08 barryhughes

@eddr since you are creating a WooCommerce extension, you can presumably depend on WooCommerce being present (or can test for it). WooCommerce includes its own copy of Action Scheduler, and it should therefore be possible to use that from your extension (or else you can use WC()->queue() which effectively wraps it).

I acknowledge this comes with some trade-offs (ie, you may not be able to take advantage of the very latest functionality)—but it is probably the most practical path forward at present.

barryhughes avatar Aug 01 '23 17:08 barryhughes

Hi! Thank you very much!

I am aware that the AS included in WC, yes The biggest problem for me is that the extension in mind should work even if WC if not active..

eddr avatar Aug 03 '23 06:08 eddr

Gotcha ... in that case, I don't have an easy workaround I can share. I've updated the issue title and description, though, to create a task for cleaning things up within the Action Scheduler codebase (on our end, it is not likely something we can prioritize straight away, however).

barryhughes avatar Aug 03 '23 17:08 barryhughes

Thanks

I really think it's mostly a problem with the WC extension submitting system

eddr avatar Aug 03 '23 17:08 eddr