From aaf2691bdf6e3af31ff0855255f7d24d9db3e745 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Thu, 10 Oct 2024 08:38:47 +0530 Subject: [PATCH 1/4] Make it work --- includes/Config.php | 9 +++++++ includes/Plugins.php | 56 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/includes/Config.php b/includes/Config.php index 7671983..4b988f3 100644 --- a/includes/Config.php +++ b/includes/Config.php @@ -66,4 +66,13 @@ public static function has_ai_sitegen() { public static function can_migrate_site() { return self::get_site_capability( 'canMigrateSite' ); } + + /** + * Gets the current site's capability if it has solution. + * + * @return boolean + */ + public static function has_solution() { + return self::get_site_capability( 'hasSolution' ); + } } diff --git a/includes/Plugins.php b/includes/Plugins.php index ad23d49..bc19ff5 100644 --- a/includes/Plugins.php +++ b/includes/Plugins.php @@ -55,13 +55,55 @@ final class Plugins { ), ), 'site-capabilities' => array( - 'hasEcomdash' => array( + 'hasEcomdash' => array( array( 'slug' => 'nfd_slug_ecomdash_wordpress_plugin', 'activate' => true, 'priority' => 220, ), ), + 'hasYithExtended' => array( + array( + 'slug' => 'woocommerce', + 'activate' => true, + 'priority' => 300, + ), + array( + 'slug' => 'nfd_slug_yith_woocommerce_booking', + 'activate' => true, + 'priority' => 100, + ), + array( + 'slug' => 'yith-woocommerce-ajax-search', + 'activate' => true, + 'priority' => 120, + ), + array( + 'slug' => 'nfd_slug_yith_woocommerce_gift_cards', + 'activate' => true, + 'priority' => 140, + ), + array( + 'slug' => 'nfd_slug_yith_woocommerce_wishlist', + 'activate' => true, + 'priority' => 160, + ), + array( + 'slug' => 'nfd_slug_yith_woocommerce_customize_myaccount_page', + 'activate' => true, + 'priority' => 180, + ), + array( + 'slug' => 'nfd_slug_yith_woocommerce_ajax_product_filter', + 'activate' => true, + 'priority' => 200, + ), + array( + 'slug' => 'nfd_slug_wonder_cart', + 'activate' => true, + 'priority' => 210, + ), + ), ), 'ecommerce' => array( 'default' => array( @@ -213,6 +255,13 @@ final class Plugins { ), ); + /** + * An array of capabilities that should not be run if the site has solution. + * + * @return array + */ + protected static $solution_override_capabilities = array( 'hasYithExtended' ); + /** * Get the list of initial plugins to be installed for a particular hosting plan. * @@ -227,6 +276,11 @@ public static function get_init() { $plugins_data_for_site_capabilities = self::$init_list['site-capabilities']; foreach ( $plugins_data_for_site_capabilities as $site_capability => $plugins_data ) { + // Skip capability installation if solution is present. + if ( Config::has_solution() && + in_array( $site_capability, self::$solution_override_capabilities ) ) { + continue; + } // Check if the capability is enabled on Hiive if ( true === Config::get_site_capability( $site_capability ) ) { // Check if there are plugins for the flag. From c61f3f3310271ecfe048a906a7caca88fd0e4d67 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 21 Oct 2024 11:37:33 -0400 Subject: [PATCH 2/4] update to latest installer module also run `composer bump` to list specific current module versions --- composer.json | 20 ++++++++++---------- composer.lock | 14 +++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 353cb8b..f33feea 100644 --- a/composer.json +++ b/composer.json @@ -25,20 +25,20 @@ } }, "require": { - "newfold-labs/wp-module-installer": "^1.2.0-beta", + "newfold-labs/wp-module-installer": "^1.2.0-beta.4", "newfold-labs/wp-module-patterns": "^2.5", - "newfold-labs/wp-module-ai": "^1.1", + "newfold-labs/wp-module-ai": "^1.1.12", "wp-forge/wp-upgrade-handler": "^1.0", - "mustache/mustache": "^2.14", - "newfold-labs/wp-module-data": "^2.6", - "newfold-labs/wp-module-coming-soon": "^1.2", - "newfold-labs/wp-module-performance": "^2.0", - "newfold-labs/wp-module-install-checker": "^1.0", - "newfold-labs/wp-module-survey": "^1.0" + "mustache/mustache": "^2.14.2", + "newfold-labs/wp-module-data": "^2.6.3", + "newfold-labs/wp-module-coming-soon": "^1.2.6", + "newfold-labs/wp-module-performance": "^2.0.1", + "newfold-labs/wp-module-install-checker": "^1.0.3", + "newfold-labs/wp-module-survey": "^1.0.1" }, "require-dev": { - "newfold-labs/wp-php-standards": "^1.2", - "wp-cli/i18n-command": "^2.4.3" + "newfold-labs/wp-php-standards": "^1.2.4", + "wp-cli/i18n-command": "^2.6.2" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index c272d8c..dec27c4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "837c81fe2ee7e029194ed202cd9cc0e4", + "content-hash": "6f3d591785b1246985438f3257c983b4", "packages": [ { "name": "doctrine/inflector", @@ -540,16 +540,16 @@ }, { "name": "newfold-labs/wp-module-installer", - "version": "1.2.0-beta", + "version": "1.2.0-beta.4", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-installer.git", - "reference": "ac8d961df8e6826df952d08eeb3f5a7f9b171db0" + "reference": "8a0f103d04318f12d6801ed1f3fb4764d5b0014d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-installer/zipball/ac8d961df8e6826df952d08eeb3f5a7f9b171db0", - "reference": "ac8d961df8e6826df952d08eeb3f5a7f9b171db0", + "url": "https://api.github.com/repos/newfold-labs/wp-module-installer/zipball/8a0f103d04318f12d6801ed1f3fb4764d5b0014d", + "reference": "8a0f103d04318f12d6801ed1f3fb4764d5b0014d", "shasum": "" }, "require": { @@ -579,10 +579,10 @@ ], "description": "An installer for WordPress plugins and themes.", "support": { - "source": "https://github.com/newfold-labs/wp-module-installer/tree/1.2.0-beta", + "source": "https://github.com/newfold-labs/wp-module-installer/tree/1.2.0-beta.4", "issues": "https://github.com/newfold-labs/wp-module-installer/issues" }, - "time": "2024-10-09T08:34:34+00:00" + "time": "2024-10-21T15:00:43+00:00" }, { "name": "newfold-labs/wp-module-loader", From 32cfd66b5f327db246809996b26b51f2bd777713 Mon Sep 17 00:00:00 2001 From: Abhijit Bhatnagar Date: Wed, 23 Oct 2024 11:08:45 +0530 Subject: [PATCH 3/4] fixed PHP linting --- includes/Plugins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Plugins.php b/includes/Plugins.php index bc19ff5..2df7a19 100644 --- a/includes/Plugins.php +++ b/includes/Plugins.php @@ -258,7 +258,7 @@ final class Plugins { /** * An array of capabilities that should not be run if the site has solution. * - * @return array + * @var array */ protected static $solution_override_capabilities = array( 'hasYithExtended' ); @@ -278,7 +278,7 @@ public static function get_init() { foreach ( $plugins_data_for_site_capabilities as $site_capability => $plugins_data ) { // Skip capability installation if solution is present. if ( Config::has_solution() && - in_array( $site_capability, self::$solution_override_capabilities ) ) { + in_array( $site_capability, self::$solution_override_capabilities, true ) ) { continue; } // Check if the capability is enabled on Hiive From 1173e8cfd9adcd5b81578962c5e430b3ebd3dcc9 Mon Sep 17 00:00:00 2001 From: Abhijit Bhatnagar Date: Wed, 23 Oct 2024 15:19:48 +0530 Subject: [PATCH 4/4] updated composer packages --- composer.json | 6 +- composer.lock | 239 ++++++++++---------------------------------------- 2 files changed, 49 insertions(+), 196 deletions(-) diff --git a/composer.json b/composer.json index f33feea..bdd4665 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,12 @@ } }, "require": { - "newfold-labs/wp-module-installer": "^1.2.0-beta.4", - "newfold-labs/wp-module-patterns": "^2.5", + "newfold-labs/wp-module-installer": "^1.2.0", + "newfold-labs/wp-module-patterns": "^2.6", "newfold-labs/wp-module-ai": "^1.1.12", "wp-forge/wp-upgrade-handler": "^1.0", "mustache/mustache": "^2.14.2", - "newfold-labs/wp-module-data": "^2.6.3", + "newfold-labs/wp-module-data": "^2.6.5", "newfold-labs/wp-module-coming-soon": "^1.2.6", "newfold-labs/wp-module-performance": "^2.0.1", "newfold-labs/wp-module-install-checker": "^1.0.3", diff --git a/composer.lock b/composer.lock index dec27c4..004a922 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6f3d591785b1246985438f3257c983b4", + "content-hash": "c1e653921e60370fb50c044919a86d8b", "packages": [ { "name": "doctrine/inflector", @@ -346,20 +346,21 @@ }, { "name": "newfold-labs/wp-module-data", - "version": "2.6.3", + "version": "2.6.5", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-data.git", - "reference": "f98dfabe6a4cb10aec6dcd6e81fc7d269238e9a4" + "reference": "002cc3da70565af1708408f7d7604396d2af55e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/f98dfabe6a4cb10aec6dcd6e81fc7d269238e9a4", - "reference": "f98dfabe6a4cb10aec6dcd6e81fc7d269238e9a4", + "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/002cc3da70565af1708408f7d7604396d2af55e3", + "reference": "002cc3da70565af1708408f7d7604396d2af55e3", "shasum": "" }, "require": { "ext-json": "*", + "newfold-labs/wp-module-context": "^1.0", "newfold-labs/wp-module-loader": "^1.0.10", "wp-forge/helpers": "^2.0", "wp-forge/wp-query-builder": "^1.0.4", @@ -437,10 +438,10 @@ ], "description": "Newfold Data Module", "support": { - "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.3", + "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.5", "issues": "https://github.com/newfold-labs/wp-module-data/issues" }, - "time": "2024-08-30T19:51:58+00:00" + "time": "2024-10-18T19:30:28+00:00" }, { "name": "newfold-labs/wp-module-features", @@ -540,20 +541,20 @@ }, { "name": "newfold-labs/wp-module-installer", - "version": "1.2.0-beta.4", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-installer.git", - "reference": "8a0f103d04318f12d6801ed1f3fb4764d5b0014d" + "reference": "1d7cb9d6f35107f409bb38e31c469c8a87ccd55b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-installer/zipball/8a0f103d04318f12d6801ed1f3fb4764d5b0014d", - "reference": "8a0f103d04318f12d6801ed1f3fb4764d5b0014d", + "url": "https://api.github.com/repos/newfold-labs/wp-module-installer/zipball/1d7cb9d6f35107f409bb38e31c469c8a87ccd55b", + "reference": "1d7cb9d6f35107f409bb38e31c469c8a87ccd55b", "shasum": "" }, "require": { - "newfold-labs/wp-module-pls": "^0.1.0" + "newfold-labs/wp-module-pls": "^1.0.0" }, "require-dev": { "newfold-labs/wp-php-standards": "^1.2", @@ -579,10 +580,10 @@ ], "description": "An installer for WordPress plugins and themes.", "support": { - "source": "https://github.com/newfold-labs/wp-module-installer/tree/1.2.0-beta.4", + "source": "https://github.com/newfold-labs/wp-module-installer/tree/1.2.0", "issues": "https://github.com/newfold-labs/wp-module-installer/issues" }, - "time": "2024-10-21T15:00:43+00:00" + "time": "2024-10-23T09:22:01+00:00" }, { "name": "newfold-labs/wp-module-loader", @@ -632,16 +633,16 @@ }, { "name": "newfold-labs/wp-module-patterns", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-patterns.git", - "reference": "d5e37c1b9ac7290e117001c40fe33ac2f95af094" + "reference": "df06479f0715d40e4aadfc299e77c9062c9165db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/d5e37c1b9ac7290e117001c40fe33ac2f95af094", - "reference": "d5e37c1b9ac7290e117001c40fe33ac2f95af094", + "url": "https://api.github.com/repos/newfold-labs/wp-module-patterns/zipball/df06479f0715d40e4aadfc299e77c9062c9165db", + "reference": "df06479f0715d40e4aadfc299e77c9062c9165db", "shasum": "" }, "require": { @@ -680,10 +681,10 @@ ], "description": "WordPress Cloud Patterns", "support": { - "source": "https://github.com/newfold-labs/wp-module-patterns/tree/2.5.0", + "source": "https://github.com/newfold-labs/wp-module-patterns/tree/2.6.0", "issues": "https://github.com/newfold-labs/wp-module-patterns/issues" }, - "time": "2024-09-26T18:04:12+00:00" + "time": "2024-10-18T16:33:56+00:00" }, { "name": "newfold-labs/wp-module-performance", @@ -738,16 +739,16 @@ }, { "name": "newfold-labs/wp-module-pls", - "version": "0.1.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-pls.git", - "reference": "ffa1517c18da067dd830c809f74aee597f05dc17" + "reference": "08b7c41b3d52d66414b6234389d7f4c414477d91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-pls/zipball/ffa1517c18da067dd830c809f74aee597f05dc17", - "reference": "ffa1517c18da067dd830c809f74aee597f05dc17", + "url": "https://api.github.com/repos/newfold-labs/wp-module-pls/zipball/08b7c41b3d52d66414b6234389d7f4c414477d91", + "reference": "08b7c41b3d52d66414b6234389d7f4c414477d91", "shasum": "" }, "require": { @@ -778,10 +779,10 @@ ], "description": "A Newfold module that handles license key provisioning, validation, and other lifecycle events for registered plugins using the PLS API via Hiive.", "support": { - "source": "https://github.com/newfold-labs/wp-module-pls/tree/0.1.0", + "source": "https://github.com/newfold-labs/wp-module-pls/tree/1.0.0", "issues": "https://github.com/newfold-labs/wp-module-pls/issues" }, - "time": "2024-10-09T08:23:27+00:00" + "time": "2024-10-23T09:11:18+00:00" }, { "name": "newfold-labs/wp-module-survey", @@ -1970,91 +1971,25 @@ ], "time": "2024-09-18T10:38:58+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-24T14:02:46+00:00" - }, { "name": "symfony/finder", - "version": "v5.4.43", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ae25a9145a900764158d439653d5630191155ca0" + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", - "reference": "ae25a9145a900764158d439653d5630191155ca0", + "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2082,87 +2017,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.43" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-08-13T14:03:51+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/finder/tree/v7.1.4" }, "funding": [ { @@ -2178,20 +2033,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-08-13T14:28:19+00:00" }, { "name": "wp-cli/i18n-command", - "version": "v2.6.2", + "version": "v2.6.3", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "53518a11f314119e320597c7a8274f11b1295bdc" + "reference": "065bb3758fcbff922f1b7a01ab702aab0da79803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/53518a11f314119e320597c7a8274f11b1295bdc", - "reference": "53518a11f314119e320597c7a8274f11b1295bdc", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/065bb3758fcbff922f1b7a01ab702aab0da79803", + "reference": "065bb3758fcbff922f1b7a01ab702aab0da79803", "shasum": "" }, "require": { @@ -2245,9 +2100,9 @@ "homepage": "https://github.com/wp-cli/i18n-command", "support": { "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/v2.6.2" + "source": "https://github.com/wp-cli/i18n-command/tree/v2.6.3" }, - "time": "2024-07-03T12:50:00+00:00" + "time": "2024-10-01T11:16:25+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -2502,12 +2357,10 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "newfold-labs/wp-module-installer": 10 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" }