Comments (24)
Can someone review?
The only change I've made, and all that seems necessary, is to set
public $version = '3.5.3'
in class-woocommerce.php
.
from classic-commerce.
Change looks fine in includes\class-woocommerce.php
. However, I could not find the PR though.
from classic-commerce.
Yeah, my mistake. I'll explain on Slack. Do you want to go ahead and close this?
from classic-commerce.
Reopened pending new PR.
from classic-commerce.
When making this change on a test site I get a message in the dashboard:
If I click this I get a white screen. No errors logged.
from classic-commerce.
Plugins still show as 0.1.0...
Status report shows 3.5.3...
from classic-commerce.
The database message will be because the db version has been bumped from 0.1.0 to 3.5.3. I don't know why it should white screen. It worked when I was testing it. I will check this tomorrow.
Re CC version. The CC version and the WC version can be independent of each other. We can start CC at 1.0.0 but ensure that it reports the WC version as 3.5.3. This is the same principle used in ClassicPress. CP is at 1.1.2 but reports version 4.9.x of WP.
from classic-commerce.
Turned on debugging and got this:
Fatal error: Uncaught Error: Call to a member function push_to_queue() on null in /home/robbiema/public_html/wp-content/plugins/classic-commerce/includes/class-wc-install.php:325 Stack trace: #0 /home/robbiema/public_html/wp-content/plugins/classic-commerce/includes/class-wc-install.php(164): WC_Install::update() #1 /home/robbiema/public_html/wp-includes/class-wp-hook.php(286): WC_Install::install_actions('') #2 /home/robbiema/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /home/robbiema/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /home/robbiema/public_html/wp-admin/admin.php(156): do_action('admin_init') #5 {main} thrown in /home/robbiema/public_html/wp-content/plugins/classic-commerce/includes/class-wc-install.php on line 325
from classic-commerce.
I've just downloaded a fresh copy of CC and updated all the files on the site. Now when I change version to 3.5.3 it doesn't prompt me to update the database (and hence there is no error message).
I must have had an old version of some files in there. However, it is still confusing as the plugin page shows CC version 0.1.0, the status page shows CC version 3.5.3 and database version 0.1.0 (but the help message tells me these two should be the same).
from classic-commerce.
The update issue is interesting. We can add an HTML text In file to show this is WC 3.5.3 to remove confusion. The plugin version needs to be traceable so 0.1.0 will be fine.
from classic-commerce.
Is there some way to change the status page so it gets the version from the same place as the plugin page?
from classic-commerce.
At the moment it is using this value echo esc_html( $environment['version'] );
from classic-commerce.
Is there some way to change the status page so it gets the version from the same place as the plugin page?
Plugin gets version from the comments /**/ on the first file while the status picks from the variable updated via PR. Making it dynamic means we use something like plugin_data(). Ref https://wordpress.stackexchange.com/questions/18268/i-want-to-get-a-plugin-version-number-dynamically
from classic-commerce.
OK - I'll leave that to you coding people. 😉
The other option would be to change the heading in that field to say that the 3.5.3 value is the "Corresponding WC version", or something like that.
from classic-commerce.
The reason why the updater gives a white screen and the reason for the 'Call to a member function push_to_queue() on null
' error is because the requisite code has been removed from 'class-wc-install.php
'.
In function init()
, the following needs to be added:
add_action( 'init', array( __CLASS__, 'init_background_updater' ), 5 );
and then the following function needs to be added:
public static function init_background_updater() {
include_once dirname( __FILE__ ) . '/class-wc-background-updater.php';
self::$background_updater = new WC_Background_Updater();
}
from classic-commerce.
To update the database (woocommerce_db_version
) to the proper version:
Add the following to includes/wc-update-functions.php:
function wc_update_353_db_version() {
WC_Install::update_db_version( '3.5.3' );
}
Add the following to includes/class-wc-install.php:
'3.5.3' => array(
'wc_update_353_db_version',
)
at the end of the private static $db_updates
array.
from classic-commerce.
Regarding includes/wc-update-functions.php and includes/class-wc-install.php, is there a lot of redundant code we can get rid of?
Could everything except the code added above (i.e. everything not related to WC 3.5.3) be removed from both of these files?
Can anyone see any adverse implications of doing this?
from classic-commerce.
Regarding the status report, something like this is easy enough to do:
from classic-commerce.
Yes, that's good! Let's do that. Both values will be useful to have in a report.
from classic-commerce.
New issue created #145
from classic-commerce.
PR #146
Still need thoughts on comment re redundant code above.
from classic-commerce.
Regarding includes/wc-update-functions.php and includes/class-wc-install.php, is there a lot of redundant code we can get rid of?
Could everything except the code added above (i.e. everything not related to WC 3.5.3) be removed from both of these files?
Can anyone see any adverse implications of doing this?
This in itself brings a new issue. There is code for WC < 3.0. Do we want to maintain this? If we have an answer for this we can then sort out that issue of redundant code too.
from classic-commerce.
I was just in the process of doing a PR for this.
I think there are two separate issues.
Maintaining compatibility for WC < 3.0 is one issue.
But the issue I referred to only affects updates.
The question I am asking is: does the update code in includes/wc-update-functions.php and includes/class-wc-install.php only affect existing WC installations where someone is updating WooCommerce to a later version?
If you installed a clean copy of WooCommerce 3.5.3, would this update code still be required?
EDIT: the code I'm referring to is basically everything in includes/wc-update-functions.php except for the newly added wc_update_353_db_version()
function and everything in the $db_updates
array in includes/class-wc-install.php except for the '3.5.3' element.
from classic-commerce.
I'll move this to a new issue as #143 is closed.
from classic-commerce.
Related Issues (20)
- Downloadable and virtual products support HOT 2
- Add link in settings page to relaunch ClassicCommerce wizard and/or button to automatically create the pages ClassicCommerce needs HOT 3
- PHP notice: Undefined index: _low_stock_amount
- Implement custom database tables (eg. for orders) HOT 2
- Problem in WC_AJAX::add_to_cart()
- Wrong WC_Data_Store in function wc_update_product_stock()
- Calling wp_die() in the AJAX handlers of WC_AJAX makes it difficult to reuse code.
- replace get_post_status( $product_id ) with $product->get_status() in WC_AJAX::add_to_cart()
- Constructing objects using "$some_object = new Some_Class()" makes subclassing difficult.
- Backport fix for issue #27170 in WooCommerce related to missing product type dropdown HOT 15
- Include an automated check of WC version compatibility in plugins HOT 2
- wc_maybe_adjust_line_item_product_stock() HOT 1
- After deleting an order item the product is not restocked
- Request for additional actions for function wc_update_product_stock() HOT 4
- Check security fixes applied to WC since 3.5.3 HOT 2
- Sale ends at 00:00 instead of 11:59 PM on set day HOT 1
- Do we change WC version number in CC PR? HOT 2
- Travis Build tests failing. Move to Github Actions HOT 1
- Custom settings sections don't works HOT 3
- is_api_request function for MWP Hubspot Integration (and others) plugin(s)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classic-commerce.