Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Plugins | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| supported_plugins | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace NewfoldLabs\WP\Module\ECommerce\Data; |
| 3 | |
| 4 | /** |
| 5 | * List of Plugin Slugs/Files |
| 6 | */ |
| 7 | final class Plugins { |
| 8 | |
| 9 | /** |
| 10 | * An associative array of free plugins with their corresponding admin page URLs and file paths. |
| 11 | * |
| 12 | * @var array<string, array<string, string>> $free_plugins |
| 13 | */ |
| 14 | public static $free_plugins = array( |
| 15 | 'jetpack' => array( |
| 16 | 'url' => 'admin.php?page=jetpack#/dashboard', |
| 17 | 'file' => 'jetpack/jetpack.php', |
| 18 | ), |
| 19 | 'jetpack-boost' => array( |
| 20 | 'url' => 'admin.php?page=jetpack-boost', |
| 21 | 'file' => 'jetpack-boost/jetpack-boost.php', |
| 22 | ), |
| 23 | 'wordpress-seo' => array( |
| 24 | 'url' => 'admin.php?page=wpseo_dashboard', |
| 25 | 'file' => 'wordpress-seo/wp-seo.php', |
| 26 | ), |
| 27 | 'wpforms-lite' => array( |
| 28 | 'url' => 'admin.php?page=wpforms-overview', |
| 29 | 'file' => 'wpforms-lite/wpforms.php', |
| 30 | ), |
| 31 | 'google-analytics-for-wordpress' => array( |
| 32 | 'url' => 'admin.php?page=monsterinsights_reports', |
| 33 | 'file' => 'google-analytics-for-wordpress/googleanalytics.php', |
| 34 | ), |
| 35 | 'optinmonster' => array( |
| 36 | 'url' => 'admin.php?page=optin-monster-dashboard', |
| 37 | 'file' => 'optinmonster/optin-monster-wp-api.php', |
| 38 | ), |
| 39 | 'creative-mail-by-constant-contact' => array( |
| 40 | 'url' => 'admin.php?page=creativemail', |
| 41 | 'file' => 'creative-mail-by-constant-contact/creative-mail-plugin.php', |
| 42 | ), |
| 43 | ); |
| 44 | |
| 45 | /** |
| 46 | * An associative array of premium plugins with their corresponding admin page URLs and file paths. |
| 47 | * |
| 48 | * @var array<string, array<string, string>> $free_plugins |
| 49 | */ |
| 50 | public static $premium_plugins = array( |
| 51 | |
| 52 | //Search Engine Optimization |
| 53 | 'wp-seo' => array( |
| 54 | 'url' => 'admin.php?page=wpseo_dashboard#top#first-time-configuration', |
| 55 | 'file' => 'wordpress-seo/wp-seo.php' |
| 56 | ), |
| 57 | //Offer Content Courses |
| 58 | 'sensei-lms' => array( |
| 59 | 'url' => 'post-new.php?post_type=course', |
| 60 | 'file' => 'sensei-lms/sensei-lms.php' |
| 61 | ), |
| 62 | //Add An Affiliate Program |
| 63 | 'yith-woocommerce-affiliates' => array( |
| 64 | 'url' => 'admin.php?page=yith_wcaf_panel&tab=settings&sub_tab=settings-general', |
| 65 | 'file' => 'yith-woocommerce-affiliates-premium/init.php' |
| 66 | ), |
| 67 | //Setup Bookings |
| 68 | 'yith-woocommerce-booking' => array( |
| 69 | 'url' => 'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1', |
| 70 | 'file' => 'yith-woocommerce-booking-premium/init.php' |
| 71 | ), |
| 72 | //Setup A Loyalty Program |
| 73 | 'yith-woocommerce-points-and-rewards' => array( |
| 74 | 'url' => 'admin.php?page=yith_woocommerce_points_and_rewards&tab=points&sub_tab=points-standard', |
| 75 | 'file' => 'yith-woocommerce-points-and-rewards-premium/init.php' |
| 76 | ), |
| 77 | //Setup WishList |
| 78 | 'yith-woocommerce-wishlist' => array( |
| 79 | 'url' => 'admin.php?page=yith_wcwl_panel&tab=settings&sub_tab=settings-general', |
| 80 | 'file' => 'yith-woocommerce-wishlist-premium/init.php' |
| 81 | ), |
| 82 | //Enable Product Reviews |
| 83 | 'yith-woocommerce-advanced-reviews' => array( |
| 84 | 'url' => 'admin.php?page=yith_ywar_panel', |
| 85 | 'file' => 'yith-woocommerce-advanced-reviews-premium/init.php' |
| 86 | ), |
| 87 | //Create a Sales Campaign |
| 88 | 'yith-woocommerce-dynamic-pricing-and-discounts' => array( |
| 89 | 'url' => 'edit.php?post_type=ywdpd_discount&yith-plugin-fw-panel-skip-redirect=1', |
| 90 | 'file' => 'yith-woocommerce-dynamic-pricing-and-discounts/init.php' |
| 91 | ) |
| 92 | ); |
| 93 | |
| 94 | /** |
| 95 | * An associative array of supported plugins with their corresponding file paths and admin page URLs. |
| 96 | * |
| 97 | * @var array<string, array<string, string>> $supported_plugins |
| 98 | */ |
| 99 | public static $supported_plugins = array( |
| 100 | 'woocommerce' => array( |
| 101 | 'file' => 'woocommerce/woocommerce.php', |
| 102 | 'url' => 'admin.php?page=wc-settings', |
| 103 | ), |
| 104 | 'nfd_slug_yith_woocommerce_customize_myaccount_page' => array( |
| 105 | 'file_extended' => 'yith-woocommerce-customize-myaccount-page-extended/init.php', |
| 106 | 'file_premium' => 'yith-woocommerce-customize-myaccount-page-premium/init.php', |
| 107 | 'file' => 'yith-woocommerce-customize-myaccount-page/init.php', |
| 108 | 'url' => 'admin.php?page=yith_wcmap_panel', |
| 109 | ), |
| 110 | 'nfd_slug_yith_woocommerce_gift_cards' => array( |
| 111 | 'file_extended' => 'yith-woocommerce-gift-cards-extended/init.php', |
| 112 | 'file_premium' => 'yith-woocommerce-gift-cards-premium/init.php', |
| 113 | 'file' => 'yith-woocommerce-gift-cards/init.php', |
| 114 | 'url' => 'admin.php?page=yith_woocommerce_gift_cards_panel', |
| 115 | ), |
| 116 | 'nfd_slug_yith_woocommerce_wishlist' => array( |
| 117 | 'file_extended' => 'yith-woocommerce-wishlist-extended/init.php', |
| 118 | 'file_premium' => 'yith-woocommerce-wishlist-premium/init.php', |
| 119 | 'file' => 'yith-woocommerce-wishlist/init.php', |
| 120 | 'url' => 'admin.php?page=yith_wcwl_panel', |
| 121 | ), |
| 122 | 'nfd_slug_yith_woocommerce_ajax_product_filter' => array( |
| 123 | 'file_extended' => 'yith-woocommerce-ajax-product-filter-extended/init.php', |
| 124 | 'file_premium' => 'yith-woocommerce-ajax-product-filter-premium/init.php', |
| 125 | 'file' => 'yith-woocommerce-ajax-product-filter/init.php', |
| 126 | 'url' => 'admin.php?page=yith_wcan_panel', |
| 127 | ), |
| 128 | 'nfd_slug_yith_woocommerce_booking' => array( |
| 129 | 'file_extended' => 'yith-woocommerce-booking-extended/init.php', |
| 130 | 'file_premium' => 'yith-woocommerce-booking-premium/init.php', |
| 131 | 'file' => 'yith-woocommerce-booking/init.php', |
| 132 | 'url' => 'admin.php?page=yith_wcbk_panel', |
| 133 | ), |
| 134 | 'yith-woocommerce-ajax-search' => array( |
| 135 | 'file_extended' => 'yith-woocommerce-ajax-search-extended/init.php', |
| 136 | 'file_premium' => 'yith-woocommerce-ajax-search-premium/init.php', |
| 137 | 'file' => 'yith-woocommerce-ajax-search/init.php', |
| 138 | 'url' => 'admin.php?page=yith_wcas_panel', |
| 139 | ), |
| 140 | 'nfd_slug_yith_shippo_shippings_for_woocommerce' => array( |
| 141 | 'file' => 'yith-shippo-shippings-for-woocommerce-extended/init.php', |
| 142 | 'url' => 'admin.php?page=yith_shippo_shipping_for_woocommerce', |
| 143 | ), |
| 144 | 'nfd_slug_yith_paypal_payments_for_woocommerce' => array( |
| 145 | 'file' => 'yith-paypal-payments-for-woocommerce-extended/init.php', |
| 146 | 'url' => 'admin.php?page=yith_paypal_payments', |
| 147 | ), |
| 148 | 'nfd_slug_ecomdash_wordpress_plugin' => array( |
| 149 | 'file' => 'ecomdash-wordpress-plugin/ecomdash-plugin.php', |
| 150 | 'url' => 'admin.php?page=newfold-ecomdash', |
| 151 | ), |
| 152 | 'nfd_slug_woo_razorpay' => array( |
| 153 | 'file' => 'woo-razorpay/woo-razorpay.php', |
| 154 | 'url' => 'admin.php?page=wc-settings&tab=checkout§ion=razorpay', |
| 155 | ), |
| 156 | 'nfd_slug_wonder_cart' => array( |
| 157 | 'file' => 'wonder-cart/init.php', |
| 158 | 'url' => 'admin.php?page=wonder-cart', |
| 159 | ), |
| 160 | 'nfd_slug_yith_stripe_payments_for_woocommerce' => array( |
| 161 | 'file' => 'yith-stripe-payments-for-woocommerce-extended/init.php', |
| 162 | 'url' => 'admin.php?page=yith_stripe_payments_panel', |
| 163 | ), |
| 164 | ); |
| 165 | |
| 166 | /** |
| 167 | * Get a merged array of supported and free plugins. |
| 168 | * |
| 169 | * @return array<string, array<string, string>> A combined array of supported and free plugins. |
| 170 | */ |
| 171 | public static function supported_plugins() { |
| 172 | return array_merge( self::$supported_plugins, self::$free_plugins, self::$premium_plugins ); |
| 173 | } |
| 174 | } |