Commit Graph

454 Commits

Author SHA1 Message Date
Mike Jolley 198fdce1bf Larger placeholder to allow more resizing 2019-01-14 13:54:01 +00:00
Mike Jolley 510ed70d1e Fix check during install to create placeholder image. 2019-01-14 11:32:57 +00:00
Rodrigo Primo 0b413351a2
Merge pull request #22031 from Prospress/fix/22027
fix PHP 5.2 sniffs in class-wc-install.php
2018-12-07 11:43:46 -02:00
Rodrigo Primo a91bc5b1ec phpcs fixes using phpcbf 2018-12-04 16:04:24 -02:00
Rodrigo Primo 24fd6f89c6 Merge branch 'master' into phpcs-wp-db 2018-12-04 15:39:19 -02:00
claudiulodro d5f7afbff3 Simplify contraint 2018-11-27 11:08:47 -08:00
Ron Rennick e39a86d4ee fix PHP 5.2 sniffs in class-wc-install.php 2018-11-23 14:49:08 -04:00
Rodrigo Primo 6ec2b26972 Update WordPress.DB.PreparedSQL.NotPrepared sniff name
The latest version of WPCS that was added to WC last week, changed the name of some sniffs. This commit updates the name of one of those sniffs from WordPress.WP.PreparedSQL.NotPrepared to WordPress.DB.PreparedSQL.NotPrepared.
2018-11-23 15:10:52 -02:00
Rodrigo Primo 57f44798cb Fix phpcs violations automatically using phpcbf 2018-11-23 12:57:51 -02:00
Gerhard f7f7eebc1c Fix PHPCS issues 2018-11-16 08:29:13 +02:00
Gerhard 92bf56cde0 Add wc_update_352_drop_download_log_fk to the DB update routine. 2018-11-16 08:27:06 +02:00
Gerhard 92e9f2811b Make the wc_download_log FK use table prefix for cases where multiple single install tables are used in the same DB. 2018-11-16 08:18:25 +02:00
Ron Rennick e3f00a6fbd use multisite blog prefix in `fk_wc_download_log_permission_id` constraint name 2018-11-06 16:43:46 -04:00
Claudio Sanches 2c61e103fe Use correct block for default pages 2018-11-05 14:45:48 -02:00
Rodrigo Primo ece9f02776 Revert "First pass at using post_author instead of the post meta '_customer_user'"
This reverts commit 61c7abce4f.
2018-10-29 11:48:44 -03:00
Rodrigo Primo 487ac201c0 Revert "Bump WC version to 3.4.0"
This reverts commit 7f43c39f2f.
2018-10-29 11:44:32 -03:00
Rodrigo Primo 1d9ab63134 Revert "Punt to WC version 3.5.0"
This reverts commit ccf10f6ab2.
2018-10-29 11:37:24 -03:00
Rodrigo Primo 41d2e1cafd Change wp_woocommerce_sessions before dbDelta() is called
On PR #21245, I added a db update routine to change wp_woocommerce_sessions primary key from session_key char(32) to session_id bigint auto_increment as dbDelta() is unable to handle primary key changes (see https://core.trac.wordpress.org/ticket/40357). But I didn't realize that dbDelta() was actually trying to add a new primary key to the table without droping the old key first and this was generating the following error:

```
WordPress database error Multiple primary key defined for query ALTER TABLE wp_woocommerce_sessions ADD PRIMARY KEY  (`session_id`)
```

To prevent this error from happening, this commit moves the query that changes the primary key from db update routine to WC_Install::create_tables() so that it runs before dbDelta() is called.
2018-10-17 12:11:01 -03:00
Claudio Sanches 61f988db63
Merge branch 'master' into fix/product-review-type 2018-09-25 12:35:41 -03:00
claudiulodro d7afce5f4c Update routine to set reviews comment type 2018-09-20 09:28:39 -07:00
Rodrigo Primo 2740a686dc Change wp_woocommerce_sessions primary key
This commit changes wp_woocommerce_sessions primary key to the bigint field session_id. Before it was the char(32) field session_key. Doing this change primarily as it should reduce the occurrence of deadlocks, but also because it is not a good practice to use a char(32) field as the primary key of a table.
2018-08-31 16:56:30 -03:00
Peter Fabian d679a88156 Update redirect option during activation of MailChimp in Install Wizard. 2018-07-24 12:29:10 +02:00
Gerhard Potgieter 36b6bd79c0 Add update routines to recreate user roles 2018-07-10 10:30:11 +02:00
Gerhard Potgieter ef2f868b89 Add edit_theme_options capability to shop manager to allow access to customizer for changing WooCommerce settings. 2018-07-09 10:45:48 +02:00
Mike Jolley ff0e492a41 Setting 2018-06-27 18:38:36 +01:00
Mike Jolley 4fc64e85a6 Create placeholder image on install 2018-06-27 17:47:30 +01:00
Rodrigo Primo 43d22a2349 Merge branch 'master' into update/use-post-author-for-customer-id 2018-06-18 15:17:19 -03:00
Gerhard Potgieter 36d1c318cb Download Log FK Contraint check (#20478)
This PR introduces a check on the permission_id FK to ensure that it is not added multiple times on upgrades. It also names the key specifically to ensure future changes to the key can be targeted properly and removes old keys that were added since 3.4.0.

* Add FK check before adding the FK. Also give the FK a name to avoid auto generated names and duplicate keys.

* Remove additional OR

* Remove additional OR

* Final FK check query

* Add foreign key cleanup routine to 3.4.3 db version

* Only check on named foreign key now that we have a cleanup routine in place, use specific phpcignore

* Rework formatting of SQL query

* Change way to fetch and add FK, can't use procedural SQL, needs to be done via statements.

* Add table name to lookup

* Only clean up FK on the wc_download_log table

* Remove erenouse bracket
2018-06-18 11:47:47 -03:00
Rodrigo Primo f1f49bb27a Add WC 3.5.0 DB version update callback 2018-06-11 10:54:02 -03:00
Rodrigo Primo dd8bf8b522 Merge branch 'master' into update/use-post-author-for-customer-id 2018-06-11 10:44:14 -03:00
Rodrigo Primo fc5aef8478 Add nonce to force update WC database URL
Doing this to check if the user has intention to perform a WC database update before starting the process.
2018-06-07 09:55:47 -03:00
Rodrigo Primo a200686005 Add nonce to update WC database URL
Doing this to check if the user has intention to perform a WC database update before starting the process.
2018-06-07 09:45:18 -03:00
Gerhard Potgieter cc563c2883 Use single quotes, not a field name but a value 2018-06-04 13:31:03 +02:00
Gerhard Potgieter 193ae78037 Revert "Only run constraint if it does not already exist"
This reverts commit dcddf1b273.
2018-06-04 13:21:01 +02:00
Gerhard Potgieter dcddf1b273 Only run constraint if it does not already exist 2018-06-04 13:18:57 +02:00
Gerhard Potgieter 55d5e6c6f0 Avoid looping 2018-06-04 13:15:36 +02:00
Gerhard Potgieter 4fde0e9129 Add column data type checks to ensure they match before running the download logs constraint. 2018-06-04 13:10:05 +02:00
Mike Jolley 083c994732 Break up update routine and allow it run to multuple times 2018-05-25 14:18:19 +01:00
Rodrigo Primo c49059ce7a Merge branch 'master' into update/use-post-author-for-customer-id 2018-05-08 17:34:09 -03:00
Claudiu Lodromanean 9e1b8245be
Merge pull request #19987 from woocommerce/fix/plugin-install-get-proper-plugin-filename
Plugin installer: fix extracting filename from path
2018-05-07 14:37:40 -07:00
Paul Dechov d7dc2d45a4 Use simpler function for retrieving last array item
Also avoids array dereferencing syntax incompatible with PHP <5.4.
2018-05-07 14:50:26 -04:00
Paul Dechov 660a7eea0e Fix plugin installer extracting filename from path 2018-05-07 08:27:22 -04:00
Mike Jolley 9e9949a742 This should be on by default 2018-05-03 16:50:26 +01:00
Claudio Sanches a55ae32530
Merge pull request #19935 from woocommerce/update/19815
Hook doc update
2018-05-02 13:29:23 -03:00
Mike Jolley 06ef8c8589 Hook doc update 2018-05-02 14:28:53 +01:00
Mike Jolley e807c6151f Merge branch 'master' into update/erasure-requests 2018-05-02 14:06:47 +01:00
Claudiu Lodromanean 390288e283
Merge pull request #19914 from woocommerce/update/gdpr-log-audit
GDPR - log audit
2018-05-01 09:57:36 -07:00
Mike Jolley e8f3bac6c8 Implement log cleanup cron job (woocommerce_cleanup_logs) 2018-05-01 16:37:14 +01:00
Mike Jolley 250b7aecd5 Update function to set last active 2018-05-01 14:13:38 +01:00
Mike Jolley f59acf1350 Merge branch 'master' into update/erasure-requests 2018-05-01 13:46:53 +01:00
Mike Jolley 3c34394296 Set more defaults to reduce query count 2018-05-01 12:15:57 +01:00
Mike Jolley c765ce644d Inactive account handling 2018-04-30 15:38:45 +01:00
Claudio Sanches d496e28d08 Trigger GeoLite2 database download after update
Closes #19840
2018-04-24 15:32:27 -03:00
Gerhard Potgieter fc43bd2410 Delay tracking request by 10 seconds to allow for page load to complete first. 2018-04-24 12:42:06 +02:00
Mike Jolley 9dfb91835e Merge branch 'master' into update/gdpr-order-cleanup 2018-04-18 11:21:43 +01:00
claudiulodro f9e45bea91 Bring up-to-date with master and resolve merge conflicts 2018-04-17 13:27:39 -07:00
Claudiu Lodromanean 9821f6d23f
Merge pull request #19744 from woocommerce/update/19592
BD states and iso codes
2018-04-17 08:44:34 -07:00
Mike Jolley 9b043868e9 Update routine 2018-04-17 16:13:44 +01:00
Rodrigo Primo ccf10f6ab2 Punt to WC version 3.5.0 2018-04-17 11:12:46 -03:00
Mike Jolley 6e9e1aaa62 Daily order cleanup cron schedule 2018-04-17 12:33:22 +01:00
Paul Dechov a4f76e3529 Fix broken activation when done immediately after installation 2018-04-16 07:22:15 -04:00
Paul Dechov 3814796a24 Enhance plugin installer to accept plugin 'file'
'file' string as part of plugin information is used for activating plugin in combination with slug, or instead of slug in the case of plugins already installed. Defaults to [slug].php.
2018-04-16 07:16:59 -04:00
Mike Jolley 93d20d9c93 Data removal handling 2018-04-13 18:03:02 +01:00
Rodrigo Primo 36ca6ef901 Merge branch 'master' into update/use-post-author-for-customer-id 2018-04-11 15:19:58 -03:00
Peter Fabian ac1883ee00 Included db update scripts in WC install 2018-04-09 23:24:26 +02:00
Rodrigo Primo a7d2c5dd6e Merge branch 'master' into update/use-post-author-for-customer-id 2018-04-03 15:13:07 -03:00
Claudio Sanches b8534eee28 Fixed includes/class-wc-install.php PHPCS violations 2018-03-21 00:06:47 -03:00
Steve Grunwell 049876ac8f Add the "woocommerce_install_get_tables" filter to WC_Install::get_tables()
This commit adds a new filter, "woocommerce_install_get_tables", to the WC_Install::get_tables() method, enabling WooCommerce extensions to register new, WooCommerce-specific tables, ensuring these tables can be cleaned up automatically should WooCommerce be uninstalled (useful for things like custom table data stores). Nothing gets added by default, but this provides an integration point for plugins like WooCommerce Custom Orders Table.
2018-03-16 18:54:17 +00:00
Claudio Sanches c2966805c8
Merge pull request #19386 from woocommerce/fix/insert-term-fatal-error
Check if wp_insert_term() returned a term before using it
2018-03-13 14:33:17 -03:00
Rodrigo Primo d603ba0b68 Check if wp_insert_term() returned a term before using it
This commit adds a check to make sure wp_insert_term() returned a term and not an instance of WP_Error before trying to access it. Without this change, the old code could produce the following fatal error:

Uncaught Error: Cannot use object of type WP_Error as array in includes/class-wc-install.php:478

Fixes #19377
2018-03-13 11:02:55 -03:00
Rodrigo Primo 40c56d8ee3 Fix default product category check
This commit casts the 'default_product_cat' option to integer before passing it to `term_exists()`. If we don't do this, `get_option( 'default_product_cat' )` return a string that is passed to `term_exists( $woocommerce_default_category, 'product_cat' )`. `term_exists()` assumes that strings are term names or slugs and search only for this fields to check if the given term exist. So it will return false (unless the term name equals to the term ID which is unlikely) even though the term exists. To make it search for terms IDs to check if the given term exists, it is necessary to pass an integer.
2018-03-13 10:19:35 -03:00
Paul Dechov 08e8ca7823 Activate plugins during installation process even if directory doesn't match slug 2018-03-01 11:50:54 -05:00
Rodrigo Primo 5be9d1b118 Remove all WC tables when uninstalling the plugin
There were two outdated lists of WC tables. One used to drop tables when WC is uninstalled and another one to drop tables when a site is deleted in a multi site environment. This commit creates a new unified list of WC tables, adds the missing tables to this list and introduces a unit test that will fail if the list gets outdated.
2018-02-06 11:19:40 -02:00
Rodrigo Primo 13f703fd32 Don't call WC_Install::install() on downgrades
WC doesn't support downgrades but the if condition that decides whether or not to call WC_Install::install() and apply database schema changes was checking if the WC version stored in the database is equal to the WC version in the code. This commit changes the check performed inside the if condition to verify if the WC version stored in the database is smaller than the version in the code. This way `dbDelta()` won't be called automatically by WC and revert database schema changes. This is particulary important for clustered providers where the version of the WC code running in one of the containers could be outdated and trigger a database downgrade.
2018-02-05 14:40:51 -02:00
Rodrigo Primo 13351b3d75 phpcs fixes
Removed the print_r() call as phpcs was complaining about it and there is no need to output the version values as phpunit will do that if the test fails.
2018-02-05 14:40:36 -02:00
James Allan b2510773b1 On 3.3 upgrade set PayPal sandbox API credentials 2018-01-23 12:53:17 +10:00
Rodrigo Primo 7f43c39f2f Bump WC version to 3.4.0 2018-01-09 15:42:13 -02:00
Rodrigo Primo bf5c6f17a7 phpcs fixes 2018-01-09 15:42:08 -02:00
Rodrigo Primo 9de8478b42 Merge branch 'master' into update/use-post-author-for-customer-id 2018-01-09 15:21:12 -02:00
Shiva Poudel 0432b58182 Remove unwanted transient then were not set 2017-12-18 20:03:08 +05:45
Mike Jolley a42ba4607e
Merge pull request #18060 from woocommerce/fix/17915
Background processing; multisite should process current blog queue only
2017-12-13 12:38:19 +00:00
Mike Jolley 91803be50c Fix install_actions action name 2017-12-12 11:42:59 +00:00
Rodrigo Primo fee1dcf5f9 Merge branch 'master' into update/use-post-author-for-customer-id 2017-12-08 10:09:57 -02:00
Claudio Sanches 2f6f6112c2 Merge branch 'master' into feature/webhook-crud 2017-12-07 18:21:52 -02:00
Jonathan Belcher d38a9e2af6
Change order of commands to make DB last 2017-12-05 14:39:37 -05:00
Jonathan Belcher c39a181cb6 Clear addons transients on update to 3.3.0 2017-12-05 12:23:51 -05:00
Claudio Sanches 0f4f8a3f16
Merge branch 'master' into feature/webhook-crud 2017-12-04 12:37:10 -02:00
Mike Jolley 0a9485c465 Merge branch 'master' into feature/11259
# Conflicts:
#	assets/css/admin-rtl.css
#	assets/css/admin.css
#	includes/admin/list-tables/class-wc-admin-list-table-products.php
#	includes/class-wc-install.php
#	includes/wc-update-functions.php
2017-12-04 14:14:03 +00:00
Claudio Sanches cc20c1282c Fixed merge 2017-11-28 15:09:54 -02:00
Claudio Sanches c6f8e95b97 Merge branch 'master' into feature/webhook-crud 2017-11-28 15:09:10 -02:00
Rodrigo Primo 61c7abce4f First pass at using post_author instead of the post meta '_customer_user' 2017-11-28 10:13:30 -02:00
Claudio Sanches 8ed6e7436f
Merge pull request #17909 from woocommerce/update/phpcs-violations
Fix some PHPCS violations
2017-11-27 18:42:24 -02:00
Mike Jolley 856ae87d54 Update method 2017-11-23 15:44:17 +00:00
Mike Jolley c5a80d080b Rename so delete is hidden 2017-11-23 14:41:17 +00:00
Mike Jolley 3e921e524d Install default cat 2017-11-23 14:38:40 +00:00
Mike Jolley 3dc4277490 Install a default cat 2017-11-23 14:26:34 +00:00
Rodrigo Primo de5a21dcb0 Fix PHPCS violations in includes/class-wc-install.php 2017-11-23 12:16:47 -02:00
Rodrigo Primo e12fa54bc6 phpcbf automatic coding standard fixes 2017-11-23 12:16:47 -02:00
claudiulodro cebe335dda Update routine 2017-11-20 14:21:08 -08:00
Mike Jolley 34b7f67646
Merge pull request #17755 from woocommerce/feature/webhook-delivery-logging
Webhook Logging via WC_Logger
2017-11-20 12:29:43 +00:00
Gerhard Potgieter 0725ed11ac Remove webhook comment migration method, not needed. 2017-11-20 08:12:49 +02:00
Claudio Sanches 2669b8edc4 Webhooks migration script 2017-11-16 13:44:01 -02:00
Claudio Sanches 9fe0c7261e Merge branch 'master' into feature/webhook-crud 2017-11-16 12:20:22 -02:00
Gerhard Potgieter 3524ed2cf0 Merge branch 'master' of github.com:woocommerce/woocommerce into feature/webhook-delivery-logging 2017-11-15 14:28:14 +02:00
Mike Jolley 04d8184496 More filter options 2017-11-13 19:03:08 +00:00
Mike Jolley 3e7968d37b Merge branch 'master' into pr/16418 2017-11-13 14:37:18 +00:00
Gerhard Potgieter d7ca1d8cd8 Webhook logs update routine to move from comments to wc_logger 2017-11-09 08:02:59 +02:00
Mike Jolley 6f693d4d1a Upgrade routine 2017-11-07 19:16:44 +00:00
Claudio Sanches 368d958be4 Merge branch 'master' into feature/webhook-crud 2017-10-10 16:13:37 -03:00
Gerhard Potgieter 75003fe3dc Lock the install routine via a transient to prohibit race conditions due to firing on the init hook. 2017-09-27 17:41:26 +02:00
Mike Jolley 9c5765b625 This should be off by default 2017-09-06 10:49:03 +01:00
Mike Jolley 990e33dd07 Remove debug 2017-09-05 11:56:02 +01:00
Mike Jolley a4a9badbb9 Refactor and introduce `woocommerce_enable_auto_update_db` 2017-09-05 11:54:17 +01:00
Mike Jolley 8703481742 Merge pull request #16601 from ethitter/add/disable-mkdir
Allow install-related directory creation to be bypassed
2017-08-29 11:12:24 +01:00
Matt Miller 42e6d4dffe Removed extra tab character 2017-08-28 13:25:20 -07:00
Matt Miller a9db02d340 Variable update on sale schedule event fix
Removed extra variable declaration
2017-08-28 12:35:11 -07:00
Matt Miller 34b64764c7 Absolute value for gmt_offset in scheduled sales
In the event that you choose a -GMT value, the values are incorrect in some instances. For examples, if we choose a -7 GMT value, the gmt_offset will evaluate to '-7'.

On line 309, $ve will equal '+'.

On line 312, previously, $ve . get_option( 'gmt_offset' ) would evalute to '+-7'.
2017-08-25 15:25:39 -07:00
Erick Hitter aa881a0c47 Clarify inline doc 2017-08-24 21:42:32 -07:00
Erick Hitter c43155aff7 Allow directory creation to be bypassed 2017-08-24 21:16:32 -07:00
Josh Smith ee13db49a2 [#12517] Move download log table to const and helper, output download log report titles in standalone function, reorganize download log data store read for code readability 2017-08-23 03:10:14 +00:00
Josh Smith 868a0e0e84 Merge remote-tracking branch 'upstream/master' 2017-08-23 02:33:01 +00:00
Mike Jolley d68291b3ac Merge pull request #16086 from woocommerce/improvement/versions
Extensions version check.
2017-08-21 18:18:04 +01:00
Josh Smith 413444c616 Merge remote-tracking branch 'upstream/master' 2017-08-20 04:09:17 +00:00
Claudio Sanches 95de32d9c7 Changed webhook table name for #16390 2017-08-18 13:41:02 -03:00
Claudio Sanches 4762c04b4b Removed shop_webhook post type and removed upgrade scripts
With Webhook CRUD there is no more need to update hooks on database.
2017-08-17 11:37:57 -03:00
Claudio Sanches 1a3a2c0658 Updated webhook database schema
Allow default dates to '0000-00-00 00:00:00' and failure_count to '0'
2017-08-16 21:48:09 -03:00
Claudio Sanches e8defa48dc Webhook database schema 2017-08-16 15:37:22 -03:00
Claudio Sanches 3a12f7b494 2.1.2 db update functions 2017-08-15 13:01:28 -03:00
Claudio Sanches 339ab41bf1 Remove unfiltered_html capability from Shop Managers 2017-08-15 12:57:12 -03:00
Josh Smith fe01910b8b Fixing spacing on WC_Product and WC_Install 2017-08-11 16:49:49 +00:00
Josh Smith 644ac674d7 [#12517] Replace download_id on customer download and product download with static UUID instead of filename based hash, to preserve download links, logs, and permissions across filename changes 2017-08-05 04:42:31 +00:00
Josh Smith 399269a4f1 [#12517] Implement logging product downloads into new logging table 2017-07-30 22:38:17 +00:00
claudiulodro 45ba7fcbbb Corral things together 2017-07-13 11:00:39 -07:00
Mike Jolley b83f3cb9af handle MX state updates 2017-06-28 12:57:37 +01:00
Mike Jolley caacd65085 Update function to ensure notes have correct type (pre WC 1.6) 2017-06-08 12:18:07 +01:00
claudiulodro cad7757045 Add index to order_id 2017-06-01 11:26:35 -07:00
Mike Jolley 85b8d8661a Merge pull request #14595 from woocommerce/feature/helper
Helper: First pass at merging the Helper plugin into WooCommerce
2017-05-30 20:39:08 +01:00
Konstantin Kovshenin e8afe57593 Helper: Add contextual nags about available extension updates 2017-05-24 14:59:48 +03:00
Mike Jolley d3666738d8 Merge branch 'pr/15069' 2017-05-23 18:56:58 +01:00
Mike Jolley 15f47e00a2 Merge branch 'master' into feature/13088
# Conflicts:
#	assets/css/admin-rtl.css
#	assets/css/admin.css
#	assets/css/twenty-seventeen-rtl.css
#	assets/css/twenty-seventeen.css
#	assets/css/woocommerce-rtl.css
#	assets/css/woocommerce.css
2017-05-23 16:35:17 +01:00
Mike Jolley 956b1a6181 Adds storefront/theme step to the setup wizard
Also includes a background install to get Storefront installed and
activated on demand.

To test, use a default theme and go to wp-admin/index.php?page=wc-setup
The theme step will be after payments!
2017-05-17 17:42:18 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Akeda Bagus 881929b9b3
Fix small typo in the docblock. 2017-04-29 13:52:14 +07:00
Mike Jolley 412ddeacda When checking if the update notice should be shown, compare minor version, not the patch version
Fixes #14333
2017-04-13 13:15:49 +01:00
Mike Jolley 2eb9405caa Fix notice styling 2017-04-11 11:40:42 +01:00
Mike Jolley 6f3d0c1c11 Install terms prior to update
Closes #13770
2017-03-27 11:55:36 +01:00
Brent Shepherd 16cc914714 Restore prior order item length
To maintain backward compatibility with custom order item types,
like 'order_item_pending_switch' used by Subscriptions.
2017-03-22 10:11:46 -07:00
Mike Jolley dea59579bb description changes, and usage of ID's instead of IDs 2017-03-20 15:47:51 +00:00
Claudio Sanches 544060c0f2 Updated upgrade script from 2.7 to 3.0 2017-03-15 13:55:07 -03:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00