Commit Graph

202 Commits

Author SHA1 Message Date
Claudio Sanches ee28da5d30 Prepare default branch for 5.1 2021-01-25 16:38:22 -03:00
roykho 21f872e766
Fix merge conflict 2021-01-20 07:10:47 -08:00
roykho 52a2ce0300
Move nonce prepartion into core utilizing filter hook from WC Admin 2021-01-20 07:06:23 -08:00
Claudio Sanches ea54d5ad5f
Merge pull request #28679 from woocommerce/fix/woocommerce-gutenberg-products-block-issues-3565
Show correct WooCommerce pages status if they are using blocks vs shortcode.
2021-01-18 19:26:34 -03:00
Roy Ho 4c548951f4
Merge pull request #28521 from woocommerce/fix/26475
Create additional download permissions on product save if needed
2021-01-18 06:51:57 -08:00
Nestor Soriano 8b0bd248d6 Attach hook for adjust_download_permissions from within init_hooks
The DownloadPermissionsAdjuster class hooks to adjust_download_permissions
from within its init method. However this method is executed only
if the class is resolved, otherwise the hooks doesn't get attached
and then the scheduled action is not serviced.

To solve this, the class is resolved from WooCommerce::init_hooks.
This requires a change in DownloadPermissionsAdjuster::init
to use wc_get_container()->get( LegacyProxy::class )->get_instance_of
instead of WC()->get_instance_of, since WC() can't be used from
WooCommerce::construct (which invokes init_hooks).
2021-01-14 11:40:11 +01:00
Ilyas Foo 0e5596d1fc Transient and action passes plugin filename 2021-01-13 09:52:17 +08:00
Nestor Soriano 10eb9f832e Remove one of the duplicate handlers for 'adjust_download_permissions' 2021-01-12 10:15:53 +01:00
budzanowski 29837c42ff Refactor. 2021-01-06 11:33:28 +01:00
Ilyas Foo 0e590d1bdb Add transient and action for proxying WC plugin activation hook 2020-12-31 14:30:29 +08:00
vedanshujain 44705386a4 Prep master for 5.0.0. 2020-12-22 19:01:56 +05:30
Nestor Soriano f0b834d1ec Move the download permissions adjustment process to a scheduled action.
Also, move all the new code from the 'WC_Product_Data_Store_CPT' class
to a new separate 'DownloadPermissionsAdjuster' class.
2020-12-10 15:40:38 +01:00
Roy Ho 018dbc251d
Merge pull request #28386 from abhishek-pokhriyal/remove/bc-check-determine-locale
Remove function_exists check for determine_locale
2020-12-08 13:15:22 -08:00
Christopher Allford 686872a237
Merge pull request #28134 from woocommerce/add/2021-compat
Add support for Twenty Twenty-One theme
2020-11-24 16:26:34 -08:00
abhishek-pokhriyal 9abbd42d69 Remove function_exists check for determine_locale 2020-11-24 15:37:13 +05:30
Christopher Allford bb38673dad Prepared branch for 4.9 2020-11-13 09:38:22 -08:00
Jeffrey Pearce bf8662bf67 Adds structure for Twenty Twenty One default theme support. Issue #27766
- New class class-wc-twenty-twenty-one.php
- New stylesheet twenty-twenty-one.scss
- Updates checks for default themes in theme_support_includes() and wc_is_wp_default_theme_active()
2020-11-16 06:41:39 -06:00
Claudio Sanches f7ecbbeb35 Prepare default branch to 4.8 2020-10-20 15:20:52 -03:00
Nestor Soriano b71f876cba Reintroduce the dependency injection related code.
After the League's Container package has been reintroduced, all the
code that implements the dependency injection mechanism in woocommerce
can be brought back as well.
2020-10-08 09:28:05 +02:00
Rodrigo Primo 6a641c4b1d Bump WC version to 4.7.0 2020-09-19 15:24:12 -03:00
Rodrigo Primo fd25815a7c Prepare master for 4.6.0 development 2020-09-11 14:07:58 -03:00
Jonathan Sadowski 9da304e983 Update version in class-woocommerce.php 2020-09-09 10:35:05 -05:00
Nestor Soriano c37771521a Remove call_function, call_static, get_instance_of from class-woocommerce.php 2020-08-19 12:08:54 +02:00
Christopher Allford 82df4b3303 Removed the contents of the WC() global container helpers 2020-08-18 20:45:34 -07:00
Claudio Sanches def2ef499c Master is 4.5.0 now 2020-08-07 12:55:51 -03:00
vedanshujain 1d782f025e Deprecate API Package class because its not a package anymore. 2020-08-06 14:34:02 +05:30
vedanshujain 16473d54e9 Fixes for correct time of loading API 2020-08-06 14:34:02 +05:30
vedanshujain 4a4767ae93 Load API files. 2020-08-06 14:34:02 +05:30
Néstor Soriano 0f134ca6a2
Merge pull request #27054 from woocommerce/fix/27036
add/update correct deprecated notices on existing deprecations
2020-07-29 15:20:24 +02:00
Nestor Soriano 71462e33f3 Improevements on ExtendedContainer and LegacyProxy documentation.
Also, remove a not really needed `try` block in LegacyProxy::get_instance_of.
2020-07-24 09:25:11 +02:00
Nestor Soriano 6fd84a0401 Add shortcut methods for the LegacyProxy in the WooCommerce class.
The following methods are added and can be invoked using `WC()`,
they just redirect to the same methods in LegacyProxy:

call_function
call_static
get_instance_of
2020-07-24 09:25:11 +02:00
Nestor Soriano 064ae558ab Changes in the overall organization of the dependency injection:
- The `Container` class now implements `Psr\Container\ContainerInterface`
  (and registers itself as such), holding a private instance of the
  real container. This way it's a read-only container from the point
  of view of plugins (which should use their own containers, but
  can still use this to get WooCommerce classes).
- All registrations are now done in the `Container` constructor via
  service providers.
- The container instance is now held in a global variable, set in
  `woocommerce.php`
- Added the `wc_get_container` function for old code.
- Added the `AbstractServiceProvider` class, which inherits with the
  corresponding League's class and adds some utility methods,
  most notably `add/shareWithAutoArguments`.
- Added the `ActionsProxy` and `LegacyProxy` classes, they are
  registered via a dedicated service provider.
- `WC_Queue_Interface` is no longer resolvable via the container
  (which is for classes inside `src` only).
- All the method names in the new classes have the format `fooBarFizz`
  to be PSR4 compliant, so the MethodNameInvalid error has been
  disabled in phpcs.xml for the `src` directory.
- Introduced the `@public` annotation for public API classes
  (classes that plugins can use and whose backwards compatibility
  we guarantee), applied to `ActionsProxy` and to `LegacyProxy` for now.
- Removed the hack for the autoloader as now it doesn't work anyway.
  For the changes in this branch to work, now WP_DEBUG must be false.
2020-07-24 09:23:01 +02:00
Nestor Soriano a7829525eb Changes in the dependency injection container:
- Renamed from `ObjectContainer` to `Container`.
- It now inherits from PHP League's `Container`.
- It has now a `defineAsSharedAutowired` method.
- Initialization moved to the `WooCommerce::init_container` method.
- The static method for object resolution is now `WooCommerce::get_instance_of`.
2020-07-24 09:20:24 +02:00
Nestor Soriano 281ec18158 Undo the registration of old singletons in the DI container.
The container will in principle be used only to register classes
in the `src` directory.

Also, CustomerProvider class removed.
2020-07-24 09:20:24 +02:00
Nestor Soriano 312383ae47 First steps towards introducing a dependency injection framework.
- Add PHP League's Container package via Composer.
- Add an ObjectContainer class that encapsulates all the configuration
  and insulates the codebase from the concrete DI engine used.
- Add an improved ReflectionContainer class that will allow to
  register individual classes as singletons while autowiring.
- Use ObjectContainer to resolve the WooCommerce class, everything
  instantiated with "new" inside it, and all singletons that are
  usually obtained via WC() function.
- Introduce the CustomerProvider class.
- Introduce a service provider to resolve WC_Queue_Interface,
  this replaces the WC_Queue class.
- Mark as obsolete all the replaced "instance()" methods,
  and the entire WC_Queue class.
2020-07-24 09:20:21 +02:00
Ron Rennick 5ee0eccb7b add/update correct deprecated notices on existing deprecations 2020-07-16 17:13:08 -03:00
Peter Fabian 23028a90a1 Schema has not been updated, so revert. 2020-07-13 15:34:54 +02:00
Peter Fabian 6bc0ca724f Update versions and changelog from latest releases. 2020-07-09 13:18:51 +02:00
Peter Fabian dc0d567137
Merge pull request #26775 from woocommerce/update/php7.2
Show notice to update to latest PHP if version is < 7.2
2020-06-16 12:56:15 +02:00
vedanshujain 513b517b5b Show notice to update to latest PHP if version is < 7.2 2020-06-15 21:51:03 +05:30
Vedanshu Jain b45373fe0c Revert "Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout"" 2020-06-05 15:18:01 +05:30
vedanshujain e0de059f23 Use seperate db version to better track changes 2020-06-04 22:38:13 +05:30
Claudio Sanches f01c5a3b79 Start 4.3.0 development 2020-05-12 17:49:20 -03:00
Vedanshu Jain ee119e0a7e
Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout" 2020-04-21 15:37:21 +05:30
Peter Fabian 5a1ad5daf1 Updated min WP version to 5.2 2020-04-07 11:25:29 +02:00
Mike Jolley 62e099bd84 Add table schema 2020-04-03 15:55:15 +01:00
Rodrigo Primo 83691541c2 Bump WooCommerce version since 4.1.0 development has begun 2020-03-11 11:37:35 -03:00
Peter Fabian 7ec65a1b35 Added the WC Admin enabled db update notice. 2020-02-23 21:59:03 +01:00
Mike Jolley a67ece743d Avoid Automattic\Jetpack\Constants in main woocommerce file 2020-02-18 15:13:30 +00:00
Peter Fabian 68fe4d9f0e Used the final desired version in class WooCommerce. 2020-02-06 21:33:22 +01:00