Changeset 3823549
- Timestamp:
- 11/25/2026 06:02:17 PM (less than one hour ago)
- Location:
- pushengage
- Files:
-
- 2 edited
-
tags/4.3.1/app/Includes/LedgerPortPromo.php (modified) (3 diffs)
-
trunk/app/Includes/LedgerPortPromo.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pushengage/tags/4.3.1/app/Includes/LedgerPortPromo.php
r3823495 r3823549 3 3 namespace Pushengage\Includes; 4 4 5 use Pushengage\Integrations\Helpers as IntegrationHelpers; 6 use Pushengage\Utils\Options; 5 7 use Pushengage\Utils\RecommendedPlugins; 6 8 … … 59 61 60 62 /** 61 * Whether the promo applies to this site. 62 * 63 * WooCommerce is not required here: LedgerPort asks for it itself after 64 * it is installed. 63 * Whether the promo applies to this site: it is connected to PushEngage, 64 * runs WooCommerce, can run LedgerPort, and does not already run it. 65 65 * 66 66 * @return bool 67 67 */ 68 68 public static function is_eligible() { 69 return self::is_supported() && ! self::is_ledgerport_active(); 69 return Options::has_credentials() && self::meets_site_requirements(); 70 } 71 72 /** 73 * Everything is_eligible() asks for except the PushEngage connection. 74 * 75 * The dashboard payload uses this on its own: a site can connect without 76 * a page reload, so the dashboard checks the connection from its session. 77 * 78 * @return bool 79 */ 80 private static function meets_site_requirements() { 81 return IntegrationHelpers::is_woocommerce_active() 82 && self::is_supported() 83 && ! self::is_ledgerport_active(); 70 84 } 71 85 … … 115 129 116 130 return array( 117 'show' => self:: is_eligible() && empty( get_option( self::OPTION_DISMISSED ) ),131 'show' => self::meets_site_requirements() && empty( get_option( self::OPTION_DISMISSED ) ), 118 132 'installed' => ! empty( $addon['installed'] ), 119 133 'canInstall' => self::can_install(), -
pushengage/trunk/app/Includes/LedgerPortPromo.php
r3823495 r3823549 3 3 namespace Pushengage\Includes; 4 4 5 use Pushengage\Integrations\Helpers as IntegrationHelpers; 6 use Pushengage\Utils\Options; 5 7 use Pushengage\Utils\RecommendedPlugins; 6 8 … … 59 61 60 62 /** 61 * Whether the promo applies to this site. 62 * 63 * WooCommerce is not required here: LedgerPort asks for it itself after 64 * it is installed. 63 * Whether the promo applies to this site: it is connected to PushEngage, 64 * runs WooCommerce, can run LedgerPort, and does not already run it. 65 65 * 66 66 * @return bool 67 67 */ 68 68 public static function is_eligible() { 69 return self::is_supported() && ! self::is_ledgerport_active(); 69 return Options::has_credentials() && self::meets_site_requirements(); 70 } 71 72 /** 73 * Everything is_eligible() asks for except the PushEngage connection. 74 * 75 * The dashboard payload uses this on its own: a site can connect without 76 * a page reload, so the dashboard checks the connection from its session. 77 * 78 * @return bool 79 */ 80 private static function meets_site_requirements() { 81 return IntegrationHelpers::is_woocommerce_active() 82 && self::is_supported() 83 && ! self::is_ledgerport_active(); 70 84 } 71 85 … … 115 129 116 130 return array( 117 'show' => self:: is_eligible() && empty( get_option( self::OPTION_DISMISSED ) ),131 'show' => self::meets_site_requirements() && empty( get_option( self::OPTION_DISMISSED ) ), 118 132 'installed' => ! empty( $addon['installed'] ), 119 133 'canInstall' => self::can_install(),
Note:
See TracChangeset
for help on using the changeset viewer.