Skip to content

Commit

Permalink
v3.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Jan 28, 2025
1 parent f472e69 commit 83ba547
Show file tree
Hide file tree
Showing 21 changed files with 1,341 additions and 337 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/deploy-to-wp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ name: Deploy to WordPress.org
on:
push:
tags:
- "*"
- "*"
jobs:
tag:
name: New tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build
run: |
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ${{ secrets.SVN_PLUGIN_SLUG }}
- uses: actions/checkout@master
- name: Build
run: |
- name: Install SVN ( Subversion )
run: |
sudo apt-get update
sudo apt-get install subversion
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ${{ secrets.SVN_PLUGIN_SLUG }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ package-lock.json
# WPF Documentor
vendor/wpfactory/wpf-settings-exporter
vendor/wpfactory/wpf-documentor
wpf-documentor
wpf-documentor
npm-debug.log*
6 changes: 3 additions & 3 deletions cost-of-goods-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Plugin Name: Cost of Goods: Product Cost & Profit Calculator for WooCommerce
Plugin URI: https://wpfactory.com/item/cost-of-goods-for-woocommerce/
Description: Save product purchase costs (cost of goods) in WooCommerce. Beautifully.
Version: 3.6.1
Version: 3.6.2
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: cost-of-goods-for-woocommerce
Domain Path: /langs
Copyright: © 2024 WPFactory
WC tested up to: 9.5
Copyright: © 2025 WPFactory
WC tested up to: 9.6
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/analytics/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wc-currency', 'wp-hooks', 'wp-i18n'), 'version' => '88284d9f0100029c3f4db1731212c699');
<?php return array('dependencies' => array('wc-currency', 'wp-hooks', 'wp-i18n'), 'version' => '51abdb5f482708df63b5b9a83dff0c0c');
828 changes: 827 additions & 1 deletion includes/analytics/build/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions includes/analytics/build/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@woocommerce/currency": "^3.2.1",
"@woocommerce/dependency-extraction-webpack-plugin": "1.6.0",
"@woocommerce/eslint-plugin": "1.1.0",
"@wordpress/scripts": "^12.6.1"
"@wordpress/scripts": "^30.8.1"
}
}
1 change: 1 addition & 0 deletions includes/analytics/src/modules/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ let orders = {
value: Formatting.formatProfit(alg_wc_cog_analytics_obj.profit_template,reportTableData.totals.costs_total,reportTableData.totals.profit_total,reportTableData.totals.net_revenue),
},
];
console.log(reportTableData.totals)
reportTableData.summary = newSummary;
reportTableData.headers = this.getHeaders(reportTableData);
reportTableData.rows = this.getRows(reportTableData)//newRows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Background Process - Recalculate Orders
*
* @version 2.4.9
* @version 3.6.2
* @since 2.3.0
* @author WPFactory
*/
Expand Down Expand Up @@ -35,7 +35,7 @@ protected function get_action_label() {
/**
* task.
*
* @version 2.4.9
* @version 3.6.2
* @since 2.3.0
*
* @param mixed $item
Expand All @@ -46,7 +46,7 @@ protected function task( $item ) {
parent::task( $item );
alg_wc_cog()->core->orders->update_order_items_costs( array(
'order_id' => $item['id'],
'is_new_order' => true,
'is_new_order' => $item['is_new_order'],
'is_no_costs_only' => $item['recalculate_for_orders_with_no_costs'],
) );
return false;
Expand Down
2 changes: 1 addition & 1 deletion includes/class-alg-wc-cog.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class Alg_WC_Cost_of_Goods {
* @since 1.0.0
* @var string
*/
public $version = '3.6.1';
public $version = '3.6.2';

/**
* @since 1.0.0
Expand Down
102 changes: 12 additions & 90 deletions includes/settings/class-alg-wc-cog-settings-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Cost of Goods for WooCommerce - Tools Section Settings.
*
* @version 2.9.8
* @version 3.6.2
* @since 1.4.0
* @author WPFactory
*/
Expand Down Expand Up @@ -71,7 +71,7 @@ function get_import_tool_cron_info() {
/**
* get_settings.
*
* @version 2.9.8
* @version 3.6.2
* @since 1.4.0
* @todo [later] better descriptions
* @todo [maybe] add "PHP time limit" option, i.e. `set_time_limit()`
Expand Down Expand Up @@ -244,13 +244,21 @@ function get_settings() {
array(
'title' => __( 'Recalculate orders', 'cost-of-goods-for-woocommerce' ),
'desc' => __( 'Recalculate cost and profit for all orders', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Set items costs in all orders (overriding previous costs).', 'cost-of-goods-for-woocommerce' ) . ' ' .
__( 'Enable the checkbox and "Save changes" to run the tool.', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Enable the checkbox and "Save changes" to run the tool.', 'cost-of-goods-for-woocommerce' ),
'type' => 'checkbox',
'id' => 'alg_wc_cog_recalculate_orders_cost_and_profit_all',
'default' => 'no',
'checkboxgroup' => 'start',
'custom_attributes' => apply_filters( 'alg_wc_cog_settings', array( 'disabled' => 'disabled' ) ),
),
array(
'desc' => __( 'Override item costs on recalculation', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Disable it if you don\'t want to override the item costs.', 'cost-of-goods-for-woocommerce' ),
'type' => 'checkbox',
'id' => 'alg_wc_cog_recalculate_orders_override_item_costs',
'checkboxgroup' => 'end',
'default' => 'yes',
),
array(
'title' => __( 'Recalculate no cost orders', 'cost-of-goods-for-woocommerce' ),
'desc' => __( 'Recalculate cost and profit for orders with no costs', 'cost-of-goods-for-woocommerce' ),
Expand Down Expand Up @@ -310,96 +318,10 @@ function get_settings() {
),
);

/*$reports_settings = array(
array(
'title' => __( 'Reports', 'cost-of-goods-for-woocommerce' ),
'type' => 'title',
'id' => 'alg_wc_cog_reports_options',
),
array(
'title' => __( 'Orders report', 'cost-of-goods-for-woocommerce' ) . ': ' . __( 'Order status', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Select order statuses for the "Orders > Cost of Goods" report.', 'cost-of-goods-for-woocommerce' ) . ' ' .
__( '"Refunded" status is added automatically where applicable.', 'cost-of-goods-for-woocommerce' ) . ' ' .
__( 'If left empty then default value ("Completed", "Processing", "On hold") is used.', 'cost-of-goods-for-woocommerce' ),
'id' => 'alg_wc_cog_report_orders_order_status',
'default' => array( 'completed', 'processing', 'on-hold' ),
'type' => 'multiselect',
'class' => 'chosen_select',
'options' => array_diff_key( $this->get_order_statuses(), array_flip( array( 'cancelled', 'failed' ) ) ),
'custom_attributes' => apply_filters( 'alg_wc_cog_settings', array( 'disabled' => 'disabled' ) ),
),
array(
'title' => __( 'Orders report', 'cost-of-goods-for-woocommerce' ) . ': ' . __( 'Extra data', 'cost-of-goods-for-woocommerce' ),
'desc' => __( "To display data gathered before the plugin v2.0.0, you will need to recalculate orders cost and profit.", 'cost-of-goods-for-woocommerce' ),
'id' => 'alg_wc_cog_report_orders_extra_fields',
'default' => array(),
'type' => 'multiselect',
'class' => 'chosen_select',
'options' => array(
'_alg_wc_cog_order_items_cost' => __( 'Item costs (excluding fees)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_fees' => __( 'Fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_cost' => __( 'Shipping method fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_cost_fixed' => __( 'Shipping method fees (fixed)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_cost_percent' => __( 'Shipping method fees (percent)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_classes_cost' => __( 'Shipping classes fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_classes_cost_fixed' => __( 'Shipping classes fees (fixed)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_classes_cost_percent' => __( 'Shipping classes fees (percent)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_gateway_cost' => __( 'Gateway fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_gateway_cost_fixed' => __( 'Gateway fees (fixed)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_gateway_cost_percent' => __( 'Gateway fees (percent)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_extra_cost' => __( 'Order fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_extra_cost_fixed' => __( 'Order fees (fixed)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_extra_cost_percent' => __( 'Order fees (percent)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_extra_cost_per_order' => __( 'Per order fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_' . 'handling' . '_fee' => __( 'Per order fees: Handling', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_' . 'shipping' . '_fee' => __( 'Per order fees: Shipping', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_' . 'payment' . '_fee' => __( 'Per order fees: Payment', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_extra_cost_from_meta' => __( 'Meta fees (all)', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_shipping_extra_profit' => __( 'Shipping to profit', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_fees_extra_profit' => __( 'Fees to profit', 'cost-of-goods-for-woocommerce' ),
'_alg_wc_cog_order_taxes_extra_profit' => __( 'Taxes to profit', 'cost-of-goods-for-woocommerce' ),
),
'custom_attributes' => apply_filters( 'alg_wc_cog_settings', array( 'disabled' => 'disabled' ) ),
),
array(
'title' => __( 'Stock report', 'cost-of-goods-for-woocommerce' ) . ': ' . __( 'Get price method', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'The mechanism used to get the product price.', 'cost-of-goods-for-woocommerce' ),
'id' => 'alg_wc_cog_report_stock_price_method',
'default' => array( 'default' ),
'type' => 'select',
'class' => 'chosen_select',
'options' => array(
'default' => __( 'Function', 'cost-of-goods-for-woocommerce' ),
'excluding_tax_with_price_from_db' => __( 'Function with meta', 'cost-of-goods-for-woocommerce' ),
),
),
array(
'title' => __( 'Stock report', 'cost-of-goods-for-woocommerce' ) . ': ' . __( 'Meta query', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'Query related to costs meta in order to get the products for the stock report.', 'cost-of-goods-for-woocommerce' ).'<br />'.
sprintf( __( 'Use %s if some product doesn\'t show up on the stock report, probably if you have cost values below 1', 'cost-of-goods-for-woocommerce' ), '"' . __( 'CHAR type and not empty value', 'cost-of-goods-for-woocommerce' ) . '"' ),
'id' => 'alg_wc_cog_report_stock_meta_query',
'default' => array( 'default' ),
'type' => 'select',
'class' => 'chosen_select',
'options' => array(
'default' => __( 'Default', 'cost-of-goods-for-woocommerce' ),
'currency_as_char_and_not_empty' => __( 'Currency as Char type and not empty', 'cost-of-goods-for-woocommerce' ),
),
),
array(
'type' => 'sectionend',
'id' => 'alg_wc_cog_reports_options',
),
);*/



return array_merge(
$bulk_edit_costs_opts,
$import_tools_opts,
$order_tools_opts,
//$reports_settings,
//$analytics_settings
);
}

Expand Down
Binary file modified langs/cost-of-goods-for-woocommerce-de_DE.mo
Binary file not shown.
Loading

0 comments on commit 83ba547

Please sign in to comment.