diff --git a/composer.json b/composer.json index 9f700f4..abf6264 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,20 @@ { "type": "vcs", "url": "https://github.com/wpcodefactory/wpfactory-promoting-notice" + }, + { + "type": "vcs", + "url": "https://github.com/wpcodefactory/wpfactory-cross-selling" + }, + { + "type": "vcs", + "url": "https://github.com/wpcodefactory/wpfactory-admin-menu" } ], "require": { - "wpfactory/wpfactory-promoting-notice": "*" + "wpfactory/wpfactory-promoting-notice": "*", + "wpfactory/wpfactory-cross-selling": "*", + "wpfactory/wpfactory-admin-menu": "*" }, "config": { "preferred-install": "dist" diff --git a/composer.lock b/composer.lock index ba4d7e6..5406c32 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,119 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24141ccbb133f6f4a8788ae25f663e63", + "content-hash": "ac71b979911b537f0ee3d938ab95761f", "packages": [ + { + "name": "wpfactory/wpfactory-admin-menu", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wpcodefactory/wpfactory-admin-menu.git", + "reference": "5766f0d1337e1a94a5ed2057fe4fedd86e8562b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-admin-menu/zipball/5766f0d1337e1a94a5ed2057fe4fedd86e8562b6", + "reference": "5766f0d1337e1a94a5ed2057fe4fedd86e8562b6", + "shasum": "" + }, + "require-dev": { + "wp-cli/wp-cli-bundle": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/php/" + ] + }, + "scripts": { + "wp": [ + "vendor/bin/wp" + ], + "wp-create-pot": [ + "wp i18n make-pot src/php ./langs/wpfactory-admin-menu.pot --domain=wpfactory-admin-menu" + ], + "wp-update-po": [ + "wp i18n update-po ./langs/wpfactory-admin-menu.pot" + ], + "wp-make-mo": [ + "wp i18n make-mo ./langs/" + ], + "translate": [ + "@composer run wp-create-pot", + "@composer run wp-update-po", + "@composer run wp-make-mo" + ] + }, + "support": { + "source": "https://github.com/wpcodefactory/wpfactory-admin-menu/tree/v1.0.1", + "issues": "https://github.com/wpcodefactory/wpfactory-admin-menu/issues" + }, + "time": "2024-09-27T20:07:15+00:00" + }, + { + "name": "wpfactory/wpfactory-cross-selling", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/wpcodefactory/wpfactory-cross-selling.git", + "reference": "7157c3a9fcbf6ea5f1534cabe14de2db30c60601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-cross-selling/zipball/7157c3a9fcbf6ea5f1534cabe14de2db30c60601", + "reference": "7157c3a9fcbf6ea5f1534cabe14de2db30c60601", + "shasum": "" + }, + "require": { + "wpfactory/wpfactory-admin-menu": "*" + }, + "require-dev": { + "wp-cli/wp-cli-bundle": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/php/" + ] + }, + "scripts": { + "wp": [ + "vendor/bin/wp" + ], + "wp-create-pot": [ + "wp i18n make-pot src/php ./langs/wpfactory-cross-selling.pot --domain=wpfactory-cross-selling" + ], + "wp-update-po": [ + "wp i18n update-po ./langs/wpfactory-cross-selling.pot" + ], + "wp-make-mo": [ + "wp i18n make-mo ./langs/" + ], + "translate": [ + "@composer run wp-create-pot", + "@composer run wp-update-po", + "@composer run wp-make-mo" + ] + }, + "support": { + "source": "https://github.com/wpcodefactory/wpfactory-cross-selling/tree/v1.0.0", + "issues": "https://github.com/wpcodefactory/wpfactory-cross-selling/issues" + }, + "time": "2024-09-27T19:51:56+00:00" + }, { "name": "wpfactory/wpfactory-promoting-notice", - "version": "1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/wpcodefactory/wpfactory-promoting-notice.git", - "reference": "4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37" + "reference": "9b0dc91c32662ce9040b36a4b40827454e806856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wpcodefactory/wpfactory-promoting-notice/zipball/4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37", - "reference": "4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-promoting-notice/zipball/9b0dc91c32662ce9040b36a4b40827454e806856", + "reference": "9b0dc91c32662ce9040b36a4b40827454e806856", "shasum": "" }, "type": "library", @@ -30,10 +129,10 @@ ] }, "support": { - "source": "https://github.com/wpcodefactory/wpfactory-promoting-notice/tree/1.0.5", + "source": "https://github.com/wpcodefactory/wpfactory-promoting-notice/tree/v1.0.6", "issues": "https://github.com/wpcodefactory/wpfactory-promoting-notice/issues" }, - "time": "2021-06-07T20:53:39+00:00" + "time": "2023-03-09T14:03:49+00:00" } ], "packages-dev": [], @@ -44,5 +143,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } diff --git a/cost-of-goods-for-woocommerce.php b/cost-of-goods-for-woocommerce.php index a08c8ca..a182bc6 100644 --- a/cost-of-goods-for-woocommerce.php +++ b/cost-of-goods-for-woocommerce.php @@ -3,7 +3,7 @@ Plugin Name: Cost of Goods 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.5.0 +Version: 3.5.1 Author: WPFactory Author URI: https://wpfactory.com Text Domain: cost-of-goods-for-woocommerce diff --git a/includes/class-alg-wc-cog.php b/includes/class-alg-wc-cog.php index 8203a21..34e7de7 100644 --- a/includes/class-alg-wc-cog.php +++ b/includes/class-alg-wc-cog.php @@ -2,7 +2,7 @@ /** * Cost of Goods for WooCommerce - Costs input. * - * @version 3.4.5 + * @version 3.5.1 * @since 3.0.3 * @author WPFactory */ @@ -35,7 +35,7 @@ final class Alg_WC_Cost_of_Goods { * @since 1.0.0 * @var string */ - public $version = '3.4.9'; + public $version = '3.5.1'; /** * @since 1.0.0 @@ -87,10 +87,16 @@ public static function instance() { /** * Initializes. * - * @version 3.0.3 + * @version 3.5.1 * @since 2.8.1 */ function init() { + // Adds cross-selling library. + $this->add_cross_selling_library(); + + // Move WC Settings tab to WPFactory menu. + $this->move_wc_settings_tab_to_wpfactory_menu(); + // Localization add_action( 'init', array( $this, 'localize' ) ); @@ -122,6 +128,44 @@ function init() { ), 10 ); } + /** + * add_cross_selling_library. + * + * @version 3.5.1 + * @since 3.5.1 + * + * @return void + */ + function add_cross_selling_library(){ + if ( ! is_admin() ) { + return; + } + // Cross-selling library. + $cross_selling = new \WPFactory\WPFactory_Cross_Selling\WPFactory_Cross_Selling(); + $cross_selling->setup( array( 'plugin_file_path' => $this->get_filesystem_path() ) ); + $cross_selling->init(); + } + + /** + * move_wc_settings_tab_to_wpfactory_submenu. + * + * @version 3.5.1 + * @since 3.5.1 + * + * @return void + */ + function move_wc_settings_tab_to_wpfactory_menu() { + if ( ! is_admin() ) { + return; + } + // WC Settings tab as WPFactory submenu item. + $wpf_admin_menu = \WPFactory\WPFactory_Admin_Menu\WPFactory_Admin_Menu::get_instance(); + $wpf_admin_menu->move_wc_settings_tab_to_wpfactory_menu( array( + 'wc_settings_tab_id' => 'alg_wc_cost_of_goods', + 'menu_title' => __( 'Cost of Goods', 'cost-of-goods-for-woocommerce' ), + ) ); + } + /** * Declare compatibility with custom order tables for WooCommerce. * diff --git a/langs/cost-of-goods-for-woocommerce-de_DE.po b/langs/cost-of-goods-for-woocommerce-de_DE.po index 58a465f..f97f278 100644 --- a/langs/cost-of-goods-for-woocommerce-de_DE.po +++ b/langs/cost-of-goods-for-woocommerce-de_DE.po @@ -37,7 +37,7 @@ msgstr "WPFactory" msgid "https://wpfactory.com" msgstr "https://wpfactory.com" -#: includes/class-alg-wc-cog.php:220 +#: includes/class-alg-wc-cog.php:264 msgid "Go Pro" msgstr "Gehen Sie zum Profi" @@ -137,6 +137,7 @@ msgstr "Nicht verfügbar" #: includes/class-alg-wc-cog-orders-meta-boxes.php:116 #: includes/class-alg-wc-cog-orders-meta-boxes.php:219 +#: includes/class-alg-wc-cog.php:165 #: includes/pro/class-alg-wc-cog-pro-quick-and-bulk-edit.php:103 #: includes/settings/class-alg-wc-cog-settings-orders.php:430 #: includes/settings/class-alg-wc-cog-settings-products.php:253 @@ -226,8 +227,8 @@ msgstr "Sie verkaufen unter den Warenkosten." #: includes/class-alg-wc-cog-orders.php:754 #: includes/class-alg-wc-cog-orders.php:1198 -#: includes/pro/class-alg-wc-cog-pro.php:644 -#: includes/pro/class-alg-wc-cog-pro.php:663 +#: includes/pro/class-alg-wc-cog-pro.php:646 +#: includes/pro/class-alg-wc-cog-pro.php:665 msgid "Cost of goods" msgstr "Warenkosten" @@ -329,27 +330,27 @@ msgstr "Kosten der Option(en)." msgid "- No change -" msgstr "- Keine Änderung -" -#: includes/pro/class-alg-wc-cog-pro.php:589 +#: includes/pro/class-alg-wc-cog-pro.php:591 msgid "Orders cost and profit successfully recalculated." msgstr "Auftragskosten und Gewinn erfolgreich neu berechnet." -#: includes/pro/class-alg-wc-cog-pro.php:596 +#: includes/pro/class-alg-wc-cog-pro.php:598 msgid "Orders cost and profit recalculating via background processing. You should receive an e-mail when it's complete if the \"Advanced > Background processing > Send email\" option is enabled." msgstr "Neuberechnung der Auftragskosten und -gewinne über die Hintergrundverarbeitung. Wenn die Option \"Erweitert > Hintergrundverarbeitung > E-Mail senden\" aktiviert ist, sollten Sie nach Abschluss eine E-Mail erhalten." -#: includes/pro/class-alg-wc-cog-pro.php:599 +#: includes/pro/class-alg-wc-cog-pro.php:601 msgid "Something went wrong..." msgstr "Etwas ist schief gelaufen..." -#: includes/pro/class-alg-wc-cog-pro.php:717 +#: includes/pro/class-alg-wc-cog-pro.php:719 msgid "Cost of Goods reports are in %s and in %s." msgstr "Warenkostenberichte sind in %s und in %s." -#: includes/pro/class-alg-wc-cog-pro.php:719 +#: includes/pro/class-alg-wc-cog-pro.php:721 msgid "Reports > Orders > Cost of Goods" msgstr "Berichte > Bestellungen > Warenkosten" -#: includes/pro/class-alg-wc-cog-pro.php:721 +#: includes/pro/class-alg-wc-cog-pro.php:723 msgid "Reports > Stock > Cost of Goods" msgstr "Berichte > Lager > Warenkosten" diff --git a/langs/cost-of-goods-for-woocommerce-tr_TR.po b/langs/cost-of-goods-for-woocommerce-tr_TR.po index f383509..4c89c55 100644 --- a/langs/cost-of-goods-for-woocommerce-tr_TR.po +++ b/langs/cost-of-goods-for-woocommerce-tr_TR.po @@ -14,7 +14,7 @@ msgstr "" "X-Generator: Poedit 2.1.1\n" "X-Loco-Version: 2.4.3; wp-5.5.1\n" -#: includes/class-alg-wc-cog.php:220 +#: includes/class-alg-wc-cog.php:264 msgid "Go Pro" msgstr "Pro Sürüm Satın Al" @@ -25,6 +25,7 @@ msgstr "Malların maliyetinin altında satış yapıyorsunuz." #: includes/class-alg-wc-cog-orders-meta-boxes.php:116 #: includes/class-alg-wc-cog-orders-meta-boxes.php:219 +#: includes/class-alg-wc-cog.php:165 #: includes/pro/class-alg-wc-cog-pro-quick-and-bulk-edit.php:103 #: includes/settings/class-alg-wc-cog-settings-orders.php:430 #: includes/settings/class-alg-wc-cog-settings-products.php:253 @@ -147,8 +148,8 @@ msgstr "ücret" #: includes/class-alg-wc-cog-orders.php:754 #: includes/class-alg-wc-cog-orders.php:1198 -#: includes/pro/class-alg-wc-cog-pro.php:644 -#: includes/pro/class-alg-wc-cog-pro.php:663 +#: includes/pro/class-alg-wc-cog-pro.php:646 +#: includes/pro/class-alg-wc-cog-pro.php:665 msgid "Cost of goods" msgstr "Malların maliyeti" @@ -211,24 +212,24 @@ msgstr "Yok" msgid "- No change -" msgstr "- Değişiklik yok -" -#: includes/pro/class-alg-wc-cog-pro.php:589 +#: includes/pro/class-alg-wc-cog-pro.php:591 msgid "Orders cost and profit successfully recalculated." msgstr "Sipariş maliyeti ve karı başarıyla yeniden hesaplandı." -#: includes/pro/class-alg-wc-cog-pro.php:599 +#: includes/pro/class-alg-wc-cog-pro.php:601 msgid "Something went wrong..." msgstr "Bir şeyler yanlış gitti..." -#: includes/pro/class-alg-wc-cog-pro.php:717 +#: includes/pro/class-alg-wc-cog-pro.php:719 #, php-format msgid "Cost of Goods reports are in %s and in %s." msgstr "Mal Maliyeti raporları %s ve %s cinsindendir." -#: includes/pro/class-alg-wc-cog-pro.php:719 +#: includes/pro/class-alg-wc-cog-pro.php:721 msgid "Reports > Orders > Cost of Goods" msgstr "Raporlar> Siparişler> Malların Maliyeti" -#: includes/pro/class-alg-wc-cog-pro.php:721 +#: includes/pro/class-alg-wc-cog-pro.php:723 msgid "Reports > Stock > Cost of Goods" msgstr "Raporlar> Stok> Mal Maliyeti" @@ -1275,7 +1276,7 @@ msgstr "" msgid "Currencies costs" msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:596 +#: includes/pro/class-alg-wc-cog-pro.php:598 msgid "Orders cost and profit recalculating via background processing. You should receive an e-mail when it's complete if the \"Advanced > Background processing > Send email\" option is enabled." msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce-zh_CN.po b/langs/cost-of-goods-for-woocommerce-zh_CN.po index 8baf668..070c673 100644 --- a/langs/cost-of-goods-for-woocommerce-zh_CN.po +++ b/langs/cost-of-goods-for-woocommerce-zh_CN.po @@ -1027,7 +1027,7 @@ msgstr "保存设置之后,你需要重新计算订单成本和利润。" msgid "Here you can add extra costs for your orders, e.g. handling fees." msgstr "此部分可以增加订单额外成本,譬如:手续费。" -#: includes/class-alg-wc-cog.php:220 +#: includes/class-alg-wc-cog.php:264 msgid "Go Pro" msgstr "升级 Pro" @@ -1287,6 +1287,7 @@ msgstr "重置设置" #: includes/class-alg-wc-cog-orders-meta-boxes.php:116 #: includes/class-alg-wc-cog-orders-meta-boxes.php:219 +#: includes/class-alg-wc-cog.php:165 #: includes/pro/class-alg-wc-cog-pro-quick-and-bulk-edit.php:103 #: includes/settings/class-alg-wc-cog-settings-orders.php:430 #: includes/settings/class-alg-wc-cog-settings-products.php:253 @@ -1302,8 +1303,8 @@ msgstr "利润:%s" #: includes/class-alg-wc-cog-orders.php:754 #: includes/class-alg-wc-cog-orders.php:1198 -#: includes/pro/class-alg-wc-cog-pro.php:644 -#: includes/pro/class-alg-wc-cog-pro.php:663 +#: includes/pro/class-alg-wc-cog-pro.php:646 +#: includes/pro/class-alg-wc-cog-pro.php:665 msgid "Cost of goods" msgstr "商品成本" @@ -1532,27 +1533,27 @@ msgstr "" msgid "- No change -" msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:589 +#: includes/pro/class-alg-wc-cog-pro.php:591 msgid "Orders cost and profit successfully recalculated." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:596 +#: includes/pro/class-alg-wc-cog-pro.php:598 msgid "Orders cost and profit recalculating via background processing. You should receive an e-mail when it's complete if the \"Advanced > Background processing > Send email\" option is enabled." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:599 +#: includes/pro/class-alg-wc-cog-pro.php:601 msgid "Something went wrong..." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:717 +#: includes/pro/class-alg-wc-cog-pro.php:719 msgid "Cost of Goods reports are in %s and in %s." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:719 +#: includes/pro/class-alg-wc-cog-pro.php:721 msgid "Reports > Orders > Cost of Goods" msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:721 +#: includes/pro/class-alg-wc-cog-pro.php:723 msgid "Reports > Stock > Cost of Goods" msgstr "" diff --git a/langs/cost-of-goods-for-woocommerce.pot b/langs/cost-of-goods-for-woocommerce.pot index ade1851..d73b4d9 100644 --- a/langs/cost-of-goods-for-woocommerce.pot +++ b/langs/cost-of-goods-for-woocommerce.pot @@ -2,14 +2,14 @@ # This file is distributed under the GNU General Public License v3.0. msgid "" msgstr "" -"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.0\n" +"Project-Id-Version: cost-of-goods-for-woocommerce 3.5.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cost-of-goods-for-woocommerce\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-09-25T00:18:52+02:00\n" +"POT-Creation-Date: 2024-09-27T23:52:24+02:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: cost-of-goods-for-woocommerce\n" @@ -162,6 +162,7 @@ msgstr "" #: includes/class-alg-wc-cog-orders-meta-boxes.php:116 #: includes/class-alg-wc-cog-orders-meta-boxes.php:219 +#: includes/class-alg-wc-cog.php:165 #: includes/pro/class-alg-wc-cog-pro-quick-and-bulk-edit.php:103 #: includes/settings/class-alg-wc-cog-settings-orders.php:430 #: includes/settings/class-alg-wc-cog-settings-products.php:253 @@ -282,8 +283,8 @@ msgstr "" #: includes/class-alg-wc-cog-orders.php:754 #: includes/class-alg-wc-cog-orders.php:1198 -#: includes/pro/class-alg-wc-cog-pro.php:644 -#: includes/pro/class-alg-wc-cog-pro.php:663 +#: includes/pro/class-alg-wc-cog-pro.php:646 +#: includes/pro/class-alg-wc-cog-pro.php:665 msgid "Cost of goods" msgstr "" @@ -388,7 +389,7 @@ msgstr "" msgid "Variation archive" msgstr "" -#: includes/class-alg-wc-cog.php:220 +#: includes/class-alg-wc-cog.php:264 msgid "Go Pro" msgstr "" @@ -410,27 +411,27 @@ msgstr "" msgid "- No change -" msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:589 +#: includes/pro/class-alg-wc-cog-pro.php:591 msgid "Orders cost and profit successfully recalculated." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:596 +#: includes/pro/class-alg-wc-cog-pro.php:598 msgid "Orders cost and profit recalculating via background processing. You should receive an e-mail when it's complete if the \"Advanced > Background processing > Send email\" option is enabled." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:599 +#: includes/pro/class-alg-wc-cog-pro.php:601 msgid "Something went wrong..." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:717 +#: includes/pro/class-alg-wc-cog-pro.php:719 msgid "Cost of Goods reports are in %s and in %s." msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:719 +#: includes/pro/class-alg-wc-cog-pro.php:721 msgid "Reports > Orders > Cost of Goods" msgstr "" -#: includes/pro/class-alg-wc-cog-pro.php:721 +#: includes/pro/class-alg-wc-cog-pro.php:723 msgid "Reports > Stock > Cost of Goods" msgstr "" diff --git a/readme.txt b/readme.txt index 4d57d5a..72eed41 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmu Tags: woocommerce, cost, cost of goods, profit, profit calculator Requires at least: 6.1 Tested up to: 6.6 -Stable tag: 3.5.0 +Stable tag: 3.5.1 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -344,6 +344,10 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S == Changelog == += 3.5.1 - 27/09/2024 = +* Dev - Add Cross-selling library. +* Dev - Move settings to WPFactory menu. + = 3.5.0 - 24/09/2024 = * Dev - Orders - Calculations - Added new option "Ignore quantity". * Dev - Added the License Key Manager library. diff --git a/vendor/autoload.php b/vendor/autoload.php index 3482e9b..ba19570 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitb28c800a59b98cddcb9ba614e7aff2d0::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 247294d..a72151c 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,30 +42,79 @@ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +124,47 @@ public function getPrefixes() return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +179,11 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +226,13 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +276,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +294,12 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +319,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +343,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +365,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,6 +387,8 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +408,8 @@ public function register($prepend = false) /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -338,15 +424,18 @@ public function unregister() * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -401,6 +490,11 @@ public static function getRegisteredLoaders() return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -466,14 +560,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index e47f648..51e734a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -1,292 +1,359 @@ + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; - - - - - +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ class InstalledVersions { -private static $installed = array ( - 'root' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '8f9bc38b97ca0f1eafb7ab7a380bd812e2619aac', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '8f9bc38b97ca0f1eafb7ab7a380bd812e2619aac', - ), - 'wpfactory/wpfactory-promoting-notice' => - array ( - 'pretty_version' => '1.0.5', - 'version' => '1.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37', - ), - ), -); -private static $canGetVendors; -private static $installedByVendor = array(); - - - - - - - -public static function getInstalledPackages() -{ -$packages = array(); -foreach (self::getInstalled() as $installed) { -$packages[] = array_keys($installed['versions']); -} - - -if (1 === \count($packages)) { -return $packages[0]; -} - -return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); -} - - - - - - - - - -public static function isInstalled($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (isset($installed['versions'][$packageName])) { -return true; -} -} - -return false; -} - - - - - - - - - - - - - - -public static function satisfies(VersionParser $parser, $packageName, $constraint) -{ -$constraint = $parser->parseConstraints($constraint); -$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - -return $provided->matches($constraint); -} - - - - - - - - - - -public static function getVersionRanges($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -$ranges = array(); -if (isset($installed['versions'][$packageName]['pretty_version'])) { -$ranges[] = $installed['versions'][$packageName]['pretty_version']; -} -if (array_key_exists('aliases', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); -} -if (array_key_exists('replaced', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); -} -if (array_key_exists('provided', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); -} - -return implode(' || ', $ranges); -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['version'])) { -return null; -} - -return $installed['versions'][$packageName]['version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getPrettyVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['pretty_version'])) { -return null; -} - -return $installed['versions'][$packageName]['pretty_version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getReference($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['reference'])) { -return null; -} - -return $installed['versions'][$packageName]['reference']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getRootPackage() -{ -$installed = self::getInstalled(); - -return $installed[0]['root']; -} - - - - - - - -public static function getRawData() -{ -return self::$installed; -} - - - - - - - - - - - - - - - - - - - -public static function reload($data) -{ -self::$installed = $data; -self::$installedByVendor = array(); -} - - - - -private static function getInstalled() -{ -if (null === self::$canGetVendors) { -self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); -} - -$installed = array(); - -if (self::$canGetVendors) { -foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { -if (isset(self::$installedByVendor[$vendorDir])) { -$installed[] = self::$installedByVendor[$vendorDir]; -} elseif (is_file($vendorDir.'/composer/installed.php')) { -$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; -} -} -} - -$installed[] = self::$installed; - -return $installed; -} + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index dee7469..49907aa 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,10 +2,17 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'WPFactory\\Promoting_Notice\\Core' => $vendorDir . '/wpfactory/wpfactory-promoting-notice/src/php/class-core.php', + 'WPFactory\\WPFactory_Admin_Menu\\Singleton' => $vendorDir . '/wpfactory/wpfactory-admin-menu/src/php/trait-singleton.php', + 'WPFactory\\WPFactory_Admin_Menu\\WC_Settings_Menu_Item_Swapper' => $vendorDir . '/wpfactory/wpfactory-admin-menu/src/php/class-wc-settings-menu-item-swapper.php', + 'WPFactory\\WPFactory_Admin_Menu\\WPFactory_Admin_Menu' => $vendorDir . '/wpfactory/wpfactory-admin-menu/src/php/class-wpfactory-admin-menu.php', + 'WPFactory\\WPFactory_Cross_Selling\\Product_Categories' => $vendorDir . '/wpfactory/wpfactory-cross-selling/src/php/class-product-categories.php', + 'WPFactory\\WPFactory_Cross_Selling\\Products' => $vendorDir . '/wpfactory/wpfactory-cross-selling/src/php/class-products.php', + 'WPFactory\\WPFactory_Cross_Selling\\Singleton' => $vendorDir . '/wpfactory/wpfactory-cross-selling/src/php/trait-singleton.php', + 'WPFactory\\WPFactory_Cross_Selling\\WPFactory_Cross_Selling' => $vendorDir . '/wpfactory/wpfactory-cross-selling/src/php/class-wpfactory-cross-selling.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 491dd66..3bea4a8 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,7 +2,7 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index b265c64..3890ddc 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 57c757d..3c2cf96 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,51 +23,26 @@ public static function getLoader() } spl_autoload_register(array('ComposerAutoloaderInitb28c800a59b98cddcb9ba614e7aff2d0', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitb28c800a59b98cddcb9ba614e7aff2d0', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInitb28c800a59b98cddcb9ba614e7aff2d0::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInitb28c800a59b98cddcb9ba614e7aff2d0::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInitb28c800a59b98cddcb9ba614e7aff2d0::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitb28c800a59b98cddcb9ba614e7aff2d0::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequireb28c800a59b98cddcb9ba614e7aff2d0($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -function composerRequireb28c800a59b98cddcb9ba614e7aff2d0($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index eb79537..735d220 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -13,6 +13,13 @@ class ComposerStaticInitb28c800a59b98cddcb9ba614e7aff2d0 public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'WPFactory\\Promoting_Notice\\Core' => __DIR__ . '/..' . '/wpfactory/wpfactory-promoting-notice/src/php/class-core.php', + 'WPFactory\\WPFactory_Admin_Menu\\Singleton' => __DIR__ . '/..' . '/wpfactory/wpfactory-admin-menu/src/php/trait-singleton.php', + 'WPFactory\\WPFactory_Admin_Menu\\WC_Settings_Menu_Item_Swapper' => __DIR__ . '/..' . '/wpfactory/wpfactory-admin-menu/src/php/class-wc-settings-menu-item-swapper.php', + 'WPFactory\\WPFactory_Admin_Menu\\WPFactory_Admin_Menu' => __DIR__ . '/..' . '/wpfactory/wpfactory-admin-menu/src/php/class-wpfactory-admin-menu.php', + 'WPFactory\\WPFactory_Cross_Selling\\Product_Categories' => __DIR__ . '/..' . '/wpfactory/wpfactory-cross-selling/src/php/class-product-categories.php', + 'WPFactory\\WPFactory_Cross_Selling\\Products' => __DIR__ . '/..' . '/wpfactory/wpfactory-cross-selling/src/php/class-products.php', + 'WPFactory\\WPFactory_Cross_Selling\\Singleton' => __DIR__ . '/..' . '/wpfactory/wpfactory-cross-selling/src/php/trait-singleton.php', + 'WPFactory\\WPFactory_Cross_Selling\\WPFactory_Cross_Selling' => __DIR__ . '/..' . '/wpfactory/wpfactory-cross-selling/src/php/class-wpfactory-cross-selling.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 234e744..60f3f9e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,21 +1,126 @@ { "packages": [ + { + "name": "wpfactory/wpfactory-admin-menu", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/wpcodefactory/wpfactory-admin-menu.git", + "reference": "5766f0d1337e1a94a5ed2057fe4fedd86e8562b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-admin-menu/zipball/5766f0d1337e1a94a5ed2057fe4fedd86e8562b6", + "reference": "5766f0d1337e1a94a5ed2057fe4fedd86e8562b6", + "shasum": "" + }, + "require-dev": { + "wp-cli/wp-cli-bundle": "*" + }, + "time": "2024-09-27T20:07:15+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/php/" + ] + }, + "scripts": { + "wp": [ + "vendor/bin/wp" + ], + "wp-create-pot": [ + "wp i18n make-pot src/php ./langs/wpfactory-admin-menu.pot --domain=wpfactory-admin-menu" + ], + "wp-update-po": [ + "wp i18n update-po ./langs/wpfactory-admin-menu.pot" + ], + "wp-make-mo": [ + "wp i18n make-mo ./langs/" + ], + "translate": [ + "@composer run wp-create-pot", + "@composer run wp-update-po", + "@composer run wp-make-mo" + ] + }, + "support": { + "source": "https://github.com/wpcodefactory/wpfactory-admin-menu/tree/v1.0.1", + "issues": "https://github.com/wpcodefactory/wpfactory-admin-menu/issues" + }, + "install-path": "../wpfactory/wpfactory-admin-menu" + }, + { + "name": "wpfactory/wpfactory-cross-selling", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/wpcodefactory/wpfactory-cross-selling.git", + "reference": "7157c3a9fcbf6ea5f1534cabe14de2db30c60601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-cross-selling/zipball/7157c3a9fcbf6ea5f1534cabe14de2db30c60601", + "reference": "7157c3a9fcbf6ea5f1534cabe14de2db30c60601", + "shasum": "" + }, + "require": { + "wpfactory/wpfactory-admin-menu": "*" + }, + "require-dev": { + "wp-cli/wp-cli-bundle": "*" + }, + "time": "2024-09-27T19:51:56+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/php/" + ] + }, + "scripts": { + "wp": [ + "vendor/bin/wp" + ], + "wp-create-pot": [ + "wp i18n make-pot src/php ./langs/wpfactory-cross-selling.pot --domain=wpfactory-cross-selling" + ], + "wp-update-po": [ + "wp i18n update-po ./langs/wpfactory-cross-selling.pot" + ], + "wp-make-mo": [ + "wp i18n make-mo ./langs/" + ], + "translate": [ + "@composer run wp-create-pot", + "@composer run wp-update-po", + "@composer run wp-make-mo" + ] + }, + "support": { + "source": "https://github.com/wpcodefactory/wpfactory-cross-selling/tree/v1.0.0", + "issues": "https://github.com/wpcodefactory/wpfactory-cross-selling/issues" + }, + "install-path": "../wpfactory/wpfactory-cross-selling" + }, { "name": "wpfactory/wpfactory-promoting-notice", - "version": "1.0.5", - "version_normalized": "1.0.5.0", + "version": "v1.0.6", + "version_normalized": "1.0.6.0", "source": { "type": "git", "url": "https://github.com/wpcodefactory/wpfactory-promoting-notice.git", - "reference": "4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37" + "reference": "9b0dc91c32662ce9040b36a4b40827454e806856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wpcodefactory/wpfactory-promoting-notice/zipball/4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37", - "reference": "4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37", + "url": "https://api.github.com/repos/wpcodefactory/wpfactory-promoting-notice/zipball/9b0dc91c32662ce9040b36a4b40827454e806856", + "reference": "9b0dc91c32662ce9040b36a4b40827454e806856", "shasum": "" }, - "time": "2021-06-07T20:53:39+00:00", + "time": "2023-03-09T14:03:49+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -27,7 +132,7 @@ ] }, "support": { - "source": "https://github.com/wpcodefactory/wpfactory-promoting-notice/tree/1.0.5", + "source": "https://github.com/wpcodefactory/wpfactory-promoting-notice/tree/v1.0.6", "issues": "https://github.com/wpcodefactory/wpfactory-promoting-notice/issues" }, "install-path": "../wpfactory/wpfactory-promoting-notice" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index c373c1f..3a9248d 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,33 +1,50 @@ - - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( + array( + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '1d9f15215191ca2c8ec1569ccdb05ead877dea8a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, ), - 'reference' => '8f9bc38b97ca0f1eafb7ab7a380bd812e2619aac', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '8f9bc38b97ca0f1eafb7ab7a380bd812e2619aac', + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '1d9f15215191ca2c8ec1569ccdb05ead877dea8a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wpfactory/wpfactory-admin-menu' => array( + 'pretty_version' => 'v1.0.1', + 'version' => '1.0.1.0', + 'reference' => '5766f0d1337e1a94a5ed2057fe4fedd86e8562b6', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wpfactory/wpfactory-admin-menu', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wpfactory/wpfactory-cross-selling' => array( + 'pretty_version' => 'v1.0.0', + 'version' => '1.0.0.0', + 'reference' => '7157c3a9fcbf6ea5f1534cabe14de2db30c60601', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wpfactory/wpfactory-cross-selling', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wpfactory/wpfactory-promoting-notice' => array( + 'pretty_version' => 'v1.0.6', + 'version' => '1.0.6.0', + 'reference' => '9b0dc91c32662ce9040b36a4b40827454e806856', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wpfactory/wpfactory-promoting-notice', + 'aliases' => array(), + 'dev_requirement' => false, + ), ), - 'wpfactory/wpfactory-promoting-notice' => - array ( - 'pretty_version' => '1.0.5', - 'version' => '1.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '4d248f9ec4755fe6a8fc5ac0e67a098ac6e01f37', - ), - ), ); diff --git a/vendor/wpfactory/wpfactory-admin-menu/langs/wpfactory-admin-menu.pot b/vendor/wpfactory/wpfactory-admin-menu/langs/wpfactory-admin-menu.pot new file mode 100644 index 0000000..24ddab5 --- /dev/null +++ b/vendor/wpfactory/wpfactory-admin-menu/langs/wpfactory-admin-menu.pot @@ -0,0 +1,22 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-26 20:14-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.2.2\n" +"X-Domain: wpfactory-admin-menu\n" + +#: class-wpfactory-admin-menu.php:107 class-wpfactory-admin-menu.php:108 +msgid "WPFactory" +msgstr "" + +#: class-wpfactory-admin-menu.php:131 +msgid "WPFactory plugins settings" +msgstr "" diff --git a/vendor/wpfactory/wpfactory-admin-menu/src/php/class-wc-settings-menu-item-swapper.php b/vendor/wpfactory/wpfactory-admin-menu/src/php/class-wc-settings-menu-item-swapper.php new file mode 100644 index 0000000..00d1a68 --- /dev/null +++ b/vendor/wpfactory/wpfactory-admin-menu/src/php/class-wc-settings-menu-item-swapper.php @@ -0,0 +1,202 @@ + '', + 'replacement_menu_item_slug' => '', + 'page_title' => '' + ) ); + $this->args[ $args['replacement_menu_item_slug'] ] = $args; + } + + /** + * Initializes. + * + * @version 1.0.1 + * @since 1.0.1 + * + * @return void + */ + function init() { + if ( $this->initialized ) { + return; + } + $this->initialized = true; + + // Replaces WC Settings Menu Item. + add_filter( 'parent_file', array( $this, 'replace_wc_settings_menu_item' ) ); + + // Hide Current plugin Settings tab. + add_action( 'admin_head', array( $this, 'hide_plugin_settings_tab' ) ); + + // Hides WC Settings tabs. + add_action( 'admin_head', array( $this, 'hide_wc_settings_tabs' ) ); + + // Add page title. + add_action( 'all_admin_notices', array( $this, 'add_page_title' ) ); + } + + /** + * Adds page title. + * + * @version 1.0.1 + * @since 1.0.1 + * + * @return void + */ + function add_page_title() { + if ( + isset( $_GET['page'] ) && + 'wc-settings' === $_GET['page'] && + isset( $_GET['tab'] ) && + ! empty( $found_items = wp_list_filter( $this->args, array( 'wc_settings_tab_id' => $_GET['tab'] ) ) ) + ) { + $first_item = reset( $found_items ); + $page_title = $first_item['page_title']; + if ( ! empty( $page_title ) ) { + echo '

' . esc_html( $page_title ) . '

'; + } + } + } + + /** + * replace_wc_settings_menu_item. + * + * @version 1.0.1 + * @since 1.0.1 + * + * @param $file + * + * @return mixed + */ + function replace_wc_settings_menu_item( $file ) { + global $plugin_page; + if ( + 'wc-settings' === $plugin_page && + isset( $_GET['tab'] ) && + ! empty( $found_items = wp_list_filter( $this->args, array( 'wc_settings_tab_id' => $_GET['tab'] ) ) ) + ) { + $first_item = reset( $found_items ); + $replacement_menu_item_slug = $first_item['replacement_menu_item_slug']; + $plugin_page = $replacement_menu_item_slug; + } + + return $file; + } + + /** + * hide_plugin_settings_tab. + * + * @version 1.0.1 + * @since 1.0.1 + * + * @return void + */ + function hide_plugin_settings_tab() { + global $plugin_page; + if ( + 'wc-settings' === $plugin_page && + ( + ! isset( $_GET['tab'] ) || + ( isset( $_GET['tab'] ) && empty( $found_items = wp_list_filter( $this->args, array( 'wc_settings_tab_id' => $_GET['tab'] ) ) ) ) + ) + ) { + $tab_ids = array_column( $this->args, 'wc_settings_tab_id' ); + $css_selector_arr = array(); + foreach ( $tab_ids as $tab ) { + $css_selector_arr[] = '.wrap.woocommerce .nav-tab-wrapper a[href*="tab=' . $tab . '"]'; + } + + ?> + + args, array( 'wc_settings_tab_id' => $_GET['tab'] ) ) ) + ) { + $tab_ids = array_column( $this->args, 'wc_settings_tab_id' ); + $css_selector_arr = array(); + foreach ( $tab_ids as $tab ) { + $css_selector_arr[] = '.wrap.woocommerce .nav-tab-wrapper a[href*="tab=' . $tab . '"]'; + } + ?> + + localize(); + + // Setups add_menu_page params. + $this->set_menu_title( __( 'WPFactory', 'wpfactory-admin-menu' ) ); + $this->set_page_title( __( 'WPFactory', 'wpfactory-admin-menu' ) ); + $this->set_icon_url( 'data:image/svg+xml;base64,PHN2ZyBpZD0iU3ZnanNTdmcxMDAxIiB3aWR0aD0iMjg4IiBoZWlnaHQ9IjI4OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpzdmdqcz0iaHR0cDovL3N2Z2pzLmNvbS9zdmdqcyI+PGRlZnMgaWQ9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SIxIiBzdG9wLWNvbG9yPSIjNzU3NTc1IiBjbGFzcz0ic3RvcENvbG9yMEU3MEREIHN2Z1NoYXBlIj48L3N0b3A+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+PC9nPjwvc3ZnPg==' ); + + // WPFactory admin page. + add_action( 'admin_menu', array( $this, 'create_wpfactory_admin_menu' ), 9 ); + } + + /** + * Moves WooCommerce Settings tab to WPFactory menu as a submenu item. + * + * @version 1.0.1 + * @since 1.0.0 + * + * @param $args + * + * @return void + */ + public function move_wc_settings_tab_to_wpfactory_menu( $args = null ) { + if ( is_null( $this->wc_settings_menu_item_swapper ) ) { + $this->wc_settings_menu_item_swapper = new WC_Settings_Menu_Item_Swapper(); + } + $args = wp_parse_args( $args, array( + 'wc_settings_tab_id' => '', + 'page_title' => __( 'WPFactory plugins settings', 'wpfactory-admin-menu' ), + 'menu_title' => '', + 'capability' => 'manage_options', + 'position' => 30, + ) ); + $replacement_menu_item_slug = 'admin.php?page=wc-settings&tab=' . $args['wc_settings_tab_id']; + add_action( 'admin_menu', function () use ( $args, $replacement_menu_item_slug ) { + \add_submenu_page( + $this->menu_slug, + $args['menu_title'], + $args['menu_title'], + $args['capability'], + $replacement_menu_item_slug, + '', + $args['position'] + ); + } ); + $this->wc_settings_menu_item_swapper->swap( array( + 'wc_settings_tab_id' => $args['wc_settings_tab_id'], + 'replacement_menu_item_slug' => $replacement_menu_item_slug, + 'page_title' => $args['page_title'] + ) ); + $this->wc_settings_menu_item_swapper->init(); + } + + /** + * Creates WPFactory admin menu. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function create_wpfactory_admin_menu() { + \add_menu_page( + $this->get_page_title(), + $this->get_menu_title(), + $this->get_capability(), + $this->get_menu_slug(), + array( $this, 'render_page' ), + $this->get_icon_url(), + $this->get_position() + ); + + // Removes submenu page. + add_action( 'admin_head', function () { + remove_submenu_page( $this->menu_slug, $this->menu_slug ); + } ); + } + + /** + * Renders page. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function render_page() { + + } + + /** + * Localizes the plugin. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + public function localize() { + $domain = 'wpfactory-admin-menu'; + $locale = get_locale(); + $mofile = dirname( $this->get_library_file_path() ) . '/langs/' . $domain . '-' . $locale . '.mo'; + load_textdomain( $domain, $mofile ); + } + + /** + * get_menu_slug. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_menu_slug() { + return $this->menu_slug; + } + + /** + * set_menu_slug. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param string $menu_slug + */ + public function set_menu_slug( $menu_slug ) { + $this->menu_slug = $menu_slug; + } + + /** + * get_page_title. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_page_title() { + return $this->page_title; + } + + /** + * set_page_title + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param string $page_title + */ + public function set_page_title( $page_title ) { + $this->page_title = $page_title; + } + + /** + * get_menu_title. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_menu_title() { + return $this->menu_title; + } + + /** + * set_menu_title. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param string $menu_title + */ + public function set_menu_title( $menu_title ) { + $this->menu_title = $menu_title; + } + + /** + * get_capability. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_capability() { + return $this->capability; + } + + /** + * set_capability. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param string $capability + */ + public function set_capability( $capability ) { + $this->capability = $capability; + } + + /** + * get_icon_url. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_icon_url() { + return $this->icon_url; + } + + /** + * set_icon_url + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param string $icon_url + */ + public function set_icon_url( $icon_url ) { + $this->icon_url = $icon_url; + } + + /** + * get_position. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return int|string + */ + public function get_position() { + return $this->position; + } + + /** + * set_position. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param int|string $position + */ + public function set_position( $position ) { + $this->position = $position; + } + + /** + * get_version. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_version() { + return $this->version; + } + + /** + * get_file_path. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + function get_library_file_path() { + return dirname( __FILE__, 2 ); + } + } +} \ No newline at end of file diff --git a/vendor/wpfactory/wpfactory-admin-menu/src/php/trait-singleton.php b/vendor/wpfactory/wpfactory-admin-menu/src/php/trait-singleton.php new file mode 100644 index 0000000..ffebdcb --- /dev/null +++ b/vendor/wpfactory/wpfactory-admin-menu/src/php/trait-singleton.php @@ -0,0 +1,68 @@ +\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2024-09-23T03:49:09+02:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.11.0\n" +"X-Domain: wpfactory-cross-selling\n" + +#: class-products.php:46 +msgid "Wishlist for WooCommerce" +msgstr "" + +#: class-products.php:47 +msgid "Encourage More Purchases by Offering Easy Multi-Wishlist Creation and Sharing Features." +msgstr "" + +#: class-products.php:56 +msgid "Min Max Default Quantity for WooCommerce" +msgstr "" + +#: class-products.php:57 +msgid "Control Product Quantities and make shopping perfectly tailored to your store's needs." +msgstr "" + +#: class-products.php:66 +msgid "Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce" +msgstr "" + +#: class-products.php:67 +msgid "Understand your profits by accurately tracking costs. Make smarter decisions for your business and maximize your store's profitability with ease." +msgstr "" + +#: class-products.php:76 +msgid "Maximum Products per User for WooCommerce" +msgstr "" + +#: class-products.php:77 +msgid "Set maximum quantities based on your store's needs. Keep things fair, control stock, and manage sales your way!" +msgstr "" + +#: class-products.php:86 +msgid "Order Minimum/Maximum Amount for WooCommerce" +msgstr "" + +#: class-products.php:87 +msgid "Control every order with customizable limits to optimize your sales strategy." +msgstr "" + +#: class-products.php:96 +msgid "EU VAT Manager for WooCommerce" +msgstr "" + +#: class-products.php:97 +msgid "Validate VAT Numbers Automatically and Stay Compliant Across Europe. ensuring your customers have a seamless experience while you handle VAT like a pro." +msgstr "" + +#: class-products.php:106 +msgid "Email Verification for WooCommerce" +msgstr "" + +#: class-products.php:107 +msgid "Secure Your WooCommerce Store by preventing fake accounts, and ensuring real customers with user-friendly email verification." +msgstr "" + +#: class-products.php:116 +msgid "Free Shipping Over Amount: Amount Left Tracker for WooCommerce" +msgstr "" + +#: class-products.php:117 +msgid "Unlock Higher Sales with Free Shipping Incentives." +msgstr "" + +#: class-products.php:126 +msgid "Payment Methods by Product & Country for WooCommerce" +msgstr "" + +#: class-products.php:127 +msgid "Control payment methods to keep higher profit, boost conversions, and offer a better checkout experience." +msgstr "" + +#: class-products.php:136 +msgid "Product XML Feeds for WooCommerce" +msgstr "" + +#: class-products.php:137 +msgid "Create unlimited product XML feeds using this feature-rich plugin, enabling you to generate, customize, and manage XML feeds based on merchant needs. Compatible with various platforms." +msgstr "" + +#: class-products.php:146 +msgid "Popup Notices: Added to Cart, Checkout Popups & More" +msgstr "" + +#: class-products.php:147 +msgid "Capture customer attention with eye-catching, customizable popups messages." +msgstr "" + +#: class-products.php:156 +msgid "EAN and Barcodes for WooCommerce" +msgstr "" + +#: class-products.php:157 +msgid "Make Inventory Control a Breeze and Manage Your Products Seamlessly." +msgstr "" + +#: class-products.php:166 +msgid "MSRP (RRP) Pricing for WooCommerce" +msgstr "" + +#: class-products.php:167 +msgid "Encourage Purchases by Displaying MSRP and Proving Your Prices Beat the Market." +msgstr "" + +#: class-products.php:176 +msgid "File Renaming on Upload – WordPress Plugin" +msgstr "" + +#: class-products.php:177 +msgid "Elevate your WP media management with \"Rename Media Files on Upload for WordPress\" plugin. Automatically rename media images & files based on rules, sanitizes filenames, and enriches SEO through smart naming conventions." +msgstr "" + +#: class-products.php:186 +msgid "Coupons & Add to Cart by URL for WooCommerce" +msgstr "" + +#: class-products.php:187 +msgid "Simplify Shopping with One-Click Coupons and Turn Links into Sales!" +msgstr "" + +#: class-products.php:196 +msgid "Dynamic Pricing & Bulk Quantity Discounts" +msgstr "" + +#: class-products.php:197 +msgid "Boost Larger Orders and Maximize Revenue with Dynamic Pricing." +msgstr "" + +#: class-products.php:206 +msgid "Download Plugins and Themes from Dashboard" +msgstr "" + +#: class-products.php:207 +msgid "Download your WordPress plugins and themes in ZIP files directly from admin dashboard, get any or all plugins & themes without FTP or cPanel access in a single click." +msgstr "" + +#: class-products.php:216 +msgid "Back Button Widget - WordPress Plugin" +msgstr "" + +#: class-products.php:217 +msgid "Simplify navigation on your WordPress site with the \"Back Button Widget\" plugin, a light-weight & user-friendly tool to show a \"Back\" button anywhere on your website." +msgstr "" + +#: class-products.php:226 +msgid "Slugs Manager: Delete Old Permalinks " +msgstr "" + +#: class-products.php:227 +msgid "Optimize Your Site Performance by Cleaning Up Old and Unused Permalinks Effortlessly." +msgstr "" + +#: class-products.php:236 +msgid "Name Your Price: Make a Price Offer for WooCommerce" +msgstr "" + +#: class-products.php:237 +msgid "A great way to engage shoppers and drive sales through customer-driven pricing." +msgstr "" + +#: class-wpfactory-cross-selling.php:104 +#: class-wpfactory-cross-selling.php:110 +msgid "Recommendations" +msgstr "" + +#: class-wpfactory-cross-selling.php:109 +msgid "WPFactory Recommendations" +msgstr "" diff --git a/vendor/wpfactory/wpfactory-cross-selling/src/img/wpfactory.png b/vendor/wpfactory/wpfactory-cross-selling/src/img/wpfactory.png new file mode 100644 index 0000000..6453bab Binary files /dev/null and b/vendor/wpfactory/wpfactory-cross-selling/src/img/wpfactory.png differ diff --git a/vendor/wpfactory/wpfactory-cross-selling/src/php/class-product-categories.php b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-product-categories.php new file mode 100644 index 0000000..cc949b5 --- /dev/null +++ b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-product-categories.php @@ -0,0 +1,66 @@ +product_categories = array( + array( + 'name' => 'Admin & Reporting', + 'slug' => 'admin-&-reporting', + ), + array( + 'name' => 'Marketing & Promotion', + 'slug' => 'marketing-&-promotion', + ), + array( + 'name' => 'Orders Restrictions', + 'slug' => 'orders-restrictions', + ), + array( + 'name' => 'WordPress Utilities', + 'slug' => 'wordpress-utilities', + ), + ); + + return $this->product_categories; + } + } +} \ No newline at end of file diff --git a/vendor/wpfactory/wpfactory-cross-selling/src/php/class-products.php b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-products.php new file mode 100644 index 0000000..6dc7e84 --- /dev/null +++ b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-products.php @@ -0,0 +1,250 @@ +products = array( + array( + 'name' => __('Wishlist for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Encourage More Purchases by Offering Easy Multi-Wishlist Creation and Sharing Features.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/wish-list-for-woocommerce/assets/icon.svg?rev=3078494', + 'free_plugin_path' => 'wish-list-for-woocommerce/wish-list-for-woocommerce.php', + 'free_plugin_slug' => 'wish-list-for-woocommerce', + 'pro_plugin_path' => 'wish-list-for-woocommerce-pro/wish-list-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/wish-list-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory', + ), + array( + 'name' => __('Min Max Default Quantity for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Control Product Quantities and make shopping perfectly tailored to your store\'s needs.','wpfactory-cross-selling'), + 'category_slug' => 'orders-restrictions', + 'icon_url' => 'https://ps.w.org/product-quantity-for-woocommerce/assets/icon.svg?rev=2970983', + 'free_plugin_path' => 'product-quantity-for-woocommerce/product-quantity-for-woocommerce.php', + 'free_plugin_slug' => 'product-quantity-for-woocommerce', + 'pro_plugin_path' => 'product-quantity-for-woocommerce-pro/product-quantity-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/product-quantity-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Understand your profits by accurately tracking costs. Make smarter decisions for your business and maximize your store\'s profitability with ease.','wpfactory-cross-selling'), + 'category_slug' => 'admin-&-reporting', + 'icon_url' => 'https://ps.w.org/cost-of-goods-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'cost-of-goods-for-woocommerce/cost-of-goods-for-woocommerce.php', + 'free_plugin_slug' => 'cost-of-goods-for-woocommerce', + 'pro_plugin_path' => 'cost-of-goods-for-woocommerce-pro/cost-of-goods-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/cost-of-goods-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Maximum Products per User for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Set maximum quantities based on your store\'s needs. Keep things fair, control stock, and manage sales your way!','wpfactory-cross-selling'), + 'category_slug' => 'orders-restrictions', + 'icon_url' => 'https://ps.w.org/maximum-products-per-user-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'maximum-products-per-user-for-woocommerce/maximum-products-per-user-for-woocommerce.php', + 'free_plugin_slug' => 'maximum-products-per-user-for-woocommerce', + 'pro_plugin_path' => 'maximum-products-per-user-for-woocommerce-pro/maximum-products-per-user-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/maximum-products-per-user-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Order Minimum/Maximum Amount for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Control every order with customizable limits to optimize your sales strategy.','wpfactory-cross-selling'), + 'category_slug' => 'orders-restrictions', + 'icon_url' => 'https://ps.w.org/order-minimum-amount-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'order-minimum-amount-for-woocommerce/order-minimum-amount-for-woocommerce.php', + 'free_plugin_slug' => 'order-minimum-amount-for-woocommerce', + 'pro_plugin_path' => 'order-minimum-amount-for-woocommerce-pro/order-minimum-amount-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/order-minimum-maximum-amount-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('EU VAT Manager for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Validate VAT Numbers Automatically and Stay Compliant Across Europe. ensuring your customers have a seamless experience while you handle VAT like a pro.','wpfactory-cross-selling'), + 'category_slug' => 'admin-&-reporting', + 'icon_url' => 'https://ps.w.org/eu-vat-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'eu-vat-for-woocommerce/eu-vat-for-woocommerce.php', + 'free_plugin_slug' => 'eu-vat-for-woocommerce', + 'pro_plugin_path' => 'eu-vat-for-woocommerce-pro/eu-vat-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/eu-vat-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Email Verification for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Secure Your WooCommerce Store by preventing fake accounts, and ensuring real customers with user-friendly email verification.','wpfactory-cross-selling'), + 'category_slug' => 'admin-&-reporting', + 'icon_url' => 'https://ps.w.org/emails-verification-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'emails-verification-for-woocommerce/email-verification-for-woocommerce.php', + 'free_plugin_slug' => 'emails-verification-for-woocommerce', + 'pro_plugin_path' => 'email-verification-for-woocommerce-pro/email-verification-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/email-verification-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Free Shipping Over Amount: Amount Left Tracker for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Unlock Higher Sales with Free Shipping Incentives.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/amount-left-free-shipping-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'amount-left-free-shipping-woocommerce/left-to-free-shipping-for-woocommerce.php', + 'free_plugin_slug' => 'amount-left-free-shipping-woocommerce', + 'pro_plugin_path' => 'left-to-free-shipping-for-woocommerce-pro/left-to-free-shipping-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/amount-left-free-shipping-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Payment Methods by Product & Country for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Control payment methods to keep higher profit, boost conversions, and offer a better checkout experience.','wpfactory-cross-selling'), + 'category_slug' => 'orders-restrictions', + 'icon_url' => 'https://ps.w.org/payment-gateways-per-product-categories-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'payment-gateways-per-product-categories-for-woocommerce/payment-gateways-per-product-for-woocommerce.php', + 'free_plugin_slug' => 'payment-gateways-per-product-categories-for-woocommerce', + 'pro_plugin_path' => 'payment-gateways-per-product-for-woocommerce-pro/payment-gateways-per-product-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/payment-gateways-per-product-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Product XML Feeds for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Create unlimited product XML feeds using this feature-rich plugin, enabling you to generate, customize, and manage XML feeds based on merchant needs. Compatible with various platforms.','wpfactory-cross-selling'), + 'category_slug' => 'admin-&-reporting', + 'icon_url' => 'https://ps.w.org/product-xml-feeds-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'product-xml-feeds-for-woocommerce/product-xml-feeds-for-woocommerce.php.php', + 'free_plugin_slug' => 'product-xml-feeds-for-woocommerce', + 'pro_plugin_path' => 'product-xml-feeds-for-woocommerce-pro/product-xml-feeds-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/product-xml-feeds-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Popup Notices: Added to Cart, Checkout Popups & More','wpfactory-cross-selling'), + 'desc' => __('Capture customer attention with eye-catching, customizable popups messages.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/popup-notices-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'popup-notices-for-woocommerce/popup-notices-for-woocommerce.php', + 'free_plugin_slug' => 'popup-notices-for-woocommerce', + 'pro_plugin_path' => 'popup-notices-for-woocommerce-pro/popup-notices-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/popup-notices-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('EAN and Barcodes for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Make Inventory Control a Breeze and Manage Your Products Seamlessly.','wpfactory-cross-selling'), + 'category_slug' => 'admin-&-reporting', + 'icon_url' => 'https://ps.w.org/ean-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'ean-for-woocommerce/ean-for-woocommerce.php', + 'free_plugin_slug' => 'ean-for-woocommerce', + 'pro_plugin_path' => 'ean-for-woocommerce-pro/ean-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/ean-barcodes-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('MSRP (RRP) Pricing for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Encourage Purchases by Displaying MSRP and Proving Your Prices Beat the Market.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/msrp-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'msrp-for-woocommerce/msrp-for-woocommerce.php', + 'free_plugin_slug' => 'msrp-for-woocommerce', + 'pro_plugin_path' => 'msrp-for-woocommerce-pro/msrp-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/msrp-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('File Renaming on Upload – WordPress Plugin','wpfactory-cross-selling'), + 'desc' => __('Elevate your WP media management with "Rename Media Files on Upload for WordPress" plugin. Automatically rename media images & files based on rules, sanitizes filenames, and enriches SEO through smart naming conventions.','wpfactory-cross-selling'), + 'category_slug' => 'wordpress-utilities', + 'icon_url' => 'https://ps.w.org/file-renaming-on-upload/assets/icon.svg', + 'free_plugin_path' => 'file-renaming-on-upload/file-renaming-on-upload.php', + 'free_plugin_slug' => 'file-renaming-on-upload', + 'pro_plugin_path' => 'file-renaming-on-upload-pro/file-renaming-on-upload-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/file-renaming-on-upload-wordpress-plugin/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Coupons & Add to Cart by URL for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('Simplify Shopping with One-Click Coupons and Turn Links into Sales!','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/url-coupons-for-woocommerce-by-algoritmika/assets/icon.svg', + 'free_plugin_path' => 'url-coupons-for-woocommerce-by-algoritmika/url-coupons-woocommerce.php', + 'free_plugin_slug' => 'url-coupons-for-woocommerce-by-algoritmika', + 'pro_plugin_path' => 'url-coupons-woocommerce-pro/url-coupons-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/url-coupons-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Dynamic Pricing & Bulk Quantity Discounts','wpfactory-cross-selling'), + 'desc' => __('Boost Larger Orders and Maximize Revenue with Dynamic Pricing.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/wholesale-pricing-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'wholesale-pricing-woocommerce/wholesale-pricing-woocommerce.php', + 'free_plugin_slug' => 'wholesale-pricing-woocommerce', + 'pro_plugin_path' => 'wholesale-pricing-woocommerce-pro/wholesale-pricing-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/product-price-by-quantity-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Download Plugins and Themes from Dashboard','wpfactory-cross-selling'), + 'desc' => __('Download your WordPress plugins and themes in ZIP files directly from admin dashboard, get any or all plugins & themes without FTP or cPanel access in a single click.','wpfactory-cross-selling'), + 'category_slug' => 'wordpress-utilities', + 'icon_url' => 'https://ps.w.org/download-plugins-dashboard/assets/icon.svg', + 'free_plugin_path' => 'download-plugins-dashboard/download-plugins-from-dashboard.php', + 'free_plugin_slug' => 'download-plugins-dashboard', + 'pro_plugin_path' => 'download-plugins-from-dashboard-pro/download-plugins-from-dashboard-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/download-plugins-and-themes-from-dashboard/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Back Button Widget - WordPress Plugin','wpfactory-cross-selling'), + 'desc' => __('Simplify navigation on your WordPress site with the "Back Button Widget" plugin, a light-weight & user-friendly tool to show a "Back" button anywhere on your website.','wpfactory-cross-selling'), + 'category_slug' => 'wordpress-utilities', + 'icon_url' => 'https://ps.w.org/back-button-widget/assets/icon.svg', + 'free_plugin_path' => 'back-button-widget/back-button-widget.php', + 'free_plugin_slug' => 'back-button-widget', + 'pro_plugin_path' => 'back-button-widget-pro/back-button-widget-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/back-button-widget-wordpress-plugin/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Slugs Manager: Delete Old Permalinks ','wpfactory-cross-selling'), + 'desc' => __('Optimize Your Site Performance by Cleaning Up Old and Unused Permalinks Effortlessly.','wpfactory-cross-selling'), + 'category_slug' => 'wordpress-utilities', + 'icon_url' => 'https://ps.w.org/remove-old-slugspermalinks/assets/icon.svg', + 'free_plugin_path' => 'remove-old-slugspermalinks/remove-old-slugs.php', + 'free_plugin_slug' => 'remove-old-slugspermalinks', + 'pro_plugin_path' => 'remove-old-slugs-pro/remove-old-slugs-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/slugs-manager-wordpress-plugin/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + array( + 'name' => __('Name Your Price: Make a Price Offer for WooCommerce','wpfactory-cross-selling'), + 'desc' => __('A great way to engage shoppers and drive sales through customer-driven pricing.','wpfactory-cross-selling'), + 'category_slug' => 'marketing-&-promotion', + 'icon_url' => 'https://ps.w.org/price-offerings-for-woocommerce/assets/icon.svg', + 'free_plugin_path' => 'price-offerings-for-woocommerce/price-offerings-for-woocommerce.php', + 'free_plugin_slug' => 'price-offerings-for-woocommerce', + 'pro_plugin_path' => 'price-offerings-for-woocommerce-pro/price-offerings-for-woocommerce-pro.php', + 'pro_plugin_url' => 'https://wpfactory.com/item/price-offers-for-woocommerce/?utm_source=plugin&utm_medium=cross-selling&utm_campaign=wpfactory' + ), + ); + + return $this->products; + } + } +} \ No newline at end of file diff --git a/vendor/wpfactory/wpfactory-cross-selling/src/php/class-wpfactory-cross-selling.php b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-wpfactory-cross-selling.php new file mode 100644 index 0000000..3de29a7 --- /dev/null +++ b/vendor/wpfactory/wpfactory-cross-selling/src/php/class-wpfactory-cross-selling.php @@ -0,0 +1,437 @@ +localize(); + + $args = wp_parse_args( $args, array( + 'plugin_file_path' => '', + 'plugin_action_link' => array(), + 'admin_page' => array() + ) ); + + // Plugin action link. + $args['plugin_action_link'] = wp_parse_args( $args['plugin_action_link'], array( + 'enabled' => true, + 'label' => __( 'Recommendations', 'wpfactory-cross-selling' ), + ) ); + + // Menu page. + $args['admin_page'] = wp_parse_args( $args['admin_page'], array( + 'page_title' => __( 'WPFactory Recommendations', 'wpfactory-cross-selling' ), + 'menu_title' => __( 'Recommendations', 'wpfactory-cross-selling' ), + 'capability' => 'manage_options', + 'position' => 2 + ) ); + + $this->setup_args = $args; + } + + /** + * Initializes the class. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function init() { + if ( $this->initialized ) { + return; + } + $this->initialized = true; + + // Products. + $this->products = new Products(); + + // Product Categories. + $this->product_categories = new Product_Categories(); + + // WPFactory admin menu. + WPFactory_Admin_Menu::get_instance(); + + // Action links. + if ( $this->get_setup_args()['plugin_action_link']['enabled'] ) { + add_filter( 'plugin_action_links_' . $this->get_plugin_basename(), array( $this, 'add_action_links' ) ); + } + + // Cross-selling submenu. + add_action( 'admin_menu', array( $this, 'create_cross_selling_submenu' ) ); + + // Enqueues admin syles. + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) ); + } + + /** + * Localizes the plugin. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + public function localize() { + $domain = 'wpfactory-cross-selling'; + $locale = get_locale(); + $mofile = dirname( $this->get_library_file_path() ) . '/langs/' . $domain . '-' . $locale . '.mo'; + load_textdomain( $domain, $mofile ); + } + + /** + * Runs the add_action() callback if the hook_name is the current_filter. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param $hook_name + * @param $callback + * @param $priority + * @param $accepted_args + * + * @return void + */ + function add_action( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) { + if ( $hook_name === current_filter() ) { + $callback(); + } else { + add_action( $hook_name, $callback, $priority, $accepted_args ); + } + } + + /** + * Enqueues admin syles. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function enqueue_admin_styles() { + if ( ! isset( $_GET['page'] ) || $_GET['page'] !== $this->submenu_page_slug ) { + return; + } + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $css_file_path = untrailingslashit( plugin_dir_path( $this->get_library_file_path() ) ) . '/assets/css/admin' . $suffix . '.css'; + $css_file_url = untrailingslashit( plugin_dir_url( $this->get_library_file_path() ) ) . '/assets/css/admin' . $suffix . '.css'; + $version = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? current_time( 'timestamp' ) : filemtime( $css_file_path ); + wp_enqueue_style( 'wpfactory-cross-selling', $css_file_url, array(), $version ); + } + + /** + * Creates cross-selling submenu. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function create_cross_selling_submenu() { + if ( self::$submenu_initialized ) { + return; + } + self::$submenu_initialized = true; + + // Gets params. + $setup_args = $this->get_setup_args(); + $admin_page = $setup_args['admin_page'] ?? ''; + $page_title = $admin_page['page_title'] ?? ''; + $menu_title = $admin_page['menu_title'] ?? ''; + $capability = $admin_page['capability'] ?? ''; + $position = $admin_page['position'] ?? ''; + + // Creates the submenu page. + \add_submenu_page( + WPFactory_Admin_Menu::get_instance()->get_menu_slug(), + $page_title, + $menu_title, + $capability, + $this->submenu_page_slug, + array( $this, 'render_cross_selling_page' ), + $position + ); + } + + /** + * Renders cross-selling page. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return void + */ + function render_cross_selling_page() { + $setup_args = $this->get_setup_args(); + $admin_page = $setup_args['admin_page'] ?? ''; + $page_title = $admin_page['page_title'] ?? ''; + $categories = $this->product_categories->get_product_categories(); + $products = $this->products->get_products(); + ?> +
+

+ +

+ $category_data['slug'] ) ) as $product_data ): ?> + get_template( 'product.php', array( + 'product_data' => $product_data, + 'free_version_installed' => $this->is_plugin_installed( $product_data['free_plugin_path'] ), + 'pro_version_installed' => $this->is_plugin_installed( $product_data['pro_plugin_path'] ), + 'free_plugin_install_url' => $this->generate_free_plugin_install_url( $product_data['free_plugin_slug'] ), + 'pro_plugin_url' => $product_data['pro_plugin_url'] + ) ); ?> + + +
+ 'install-plugin', + 'plugin' => $plugin_slug, + '_wpnonce' => $nonce + ), + admin_url( 'update.php' ) + ); + + return $install_url; + } + + /** + * get_template + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param $template_name + * @param $args + * + * @return false|string + */ + function get_template( $template_name, $args = array() ) { + $template_path = plugin_dir_path( $this->get_library_file_path() ) . 'templates/' . $template_name; + if ( file_exists( $template_path ) ) { + ob_start(); + foreach ( $args as $key => $value ) { + $$key = $value; + } + include $template_path; + $content = ob_get_clean(); + + return $content; + } else { + return '

Template not found.

'; + } + } + + /** + * is_plugin_installed. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param $plugin_slug + * + * @return bool + */ + function is_plugin_installed( $plugin_slug ) { + $all_plugins = get_plugins(); + + return isset( $all_plugins[ $plugin_slug ] ); + } + + + /** + * Adds action links. + * + * @param $links + * + * @return array + */ + function add_action_links( $links ) { + $this->localize(); + $setup_args = $this->get_setup_args(); + $action_link = $setup_args['plugin_action_link'] ?? ''; + $label = $action_link['label'] ?? ''; + $link = admin_url( 'admin.php?page=' . $this->submenu_page_slug ); + $target = '_self'; + $custom_links[] = sprintf( '%s', esc_url( $link ), sanitize_text_field( $target ), sanitize_text_field( $label ) ); + $links = array_merge( $links, $custom_links ); + + return $links; + } + + /** + * get_setup_args. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return array + */ + public function get_setup_args() { + return $this->setup_args; + } + + /** + * get_file_path. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + function get_plugin_file_path() { + $setup_args = $this->get_setup_args(); + + return $setup_args['plugin_file_path']; + } + + /** + * get_file_path. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + function get_library_file_path() { + return dirname( __FILE__, 2 ); + } + + /** + * get_basename. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + function get_plugin_basename() { + $file_path = $this->get_plugin_file_path(); + + return plugin_basename( $file_path ); + } + + /** + * get_version. + * + * @version 1.0.0 + * @since 1.0.0 + * + * @return string + */ + public function get_version() { + return $this->version; + } + + } +} \ No newline at end of file diff --git a/vendor/wpfactory/wpfactory-cross-selling/src/php/trait-singleton.php b/vendor/wpfactory/wpfactory-cross-selling/src/php/trait-singleton.php new file mode 100644 index 0000000..ae28a03 --- /dev/null +++ b/vendor/wpfactory/wpfactory-cross-selling/src/php/trait-singleton.php @@ -0,0 +1,70 @@ + + +
+ +
+ +
+ +
+

+

+
+ +
\ No newline at end of file diff --git a/vendor/wpfactory/wpfactory-promoting-notice/src/php/class-core.php b/vendor/wpfactory/wpfactory-promoting-notice/src/php/class-core.php index 0c90b49..1f4cb9f 100644 --- a/vendor/wpfactory/wpfactory-promoting-notice/src/php/class-core.php +++ b/vendor/wpfactory/wpfactory-promoting-notice/src/php/class-core.php @@ -2,7 +2,7 @@ /** * WPFactory Promoting Notice - Functions. * - * @version 1.0.5 + * @version 1.0.6 * @since 1.0.0 * @author WPFactory */ @@ -89,7 +89,7 @@ function get_default_display_action( $args ) { /** * init. * - * @version 1.0.4 + * @version 1.0.6 * @since 1.0.0 */ function init() { @@ -99,12 +99,18 @@ function init() { } global $pagenow; if ( - ! empty( $args['url_requirements'] ) - && ! empty( $page_filename = $args['url_requirements']['page_filename'] ) - && ! empty( $url_params = $args['url_requirements']['params'] ) - && ! empty( $pagenow ) - && $pagenow == $page_filename - && array_intersect_assoc( $url_params, $_GET ) === $url_params + ! empty( $args['url_requirements'] ) && + ! empty( $page_filename = $args['url_requirements']['page_filename'] ) && + ( + ( + isset( $args['url_requirements']['params'] ) && + ! empty( $url_params = $args['url_requirements']['params'] ) && + array_intersect_assoc( $url_params, $_GET ) === $url_params + ) || + ! isset( $args['url_requirements']['params'] ) + ) && + ! empty( $pagenow ) && + $pagenow == $page_filename ) { add_action( 'admin_head', array( $this, 'create_style' ) ); add_action( 'admin_head', array( $this, 'highlight_notice_on_disabled_setting_click' ) );