| @@ -82,35 +82,13 @@ | ||
| 82 | 82 | 'team-directory', |
| 83 | 83 | 'product-review', |
| 84 | 84 | 'real-estate-listings', |
| 85 | 85 | 'business-directory', |
| 86 | - 'artist-gallery', | |
| 87 | - 'classifieds', | |
| 88 | - 'community-event-calendar', | |
| 89 | - 'company-timeline', | |
| 90 | - 'crowdfunding', | |
| 91 | - 'job-board', | |
| 92 | - 'logo-cloud', | |
| 93 | - 'multi-property-booking-system', | |
| 94 | - 'wedding-venue-booking', | |
| 95 | - 'permission-slip', | |
| 96 | - 'property-directory', | |
| 97 | - 'radio-station', | |
| 98 | - 'recipe', | |
| 99 | - 'rsvp-invite', | |
| 100 | - 'searchable-directory', | |
| 101 | - 'shopping-cart', | |
| 102 | - 'sports-league-calendar', | |
| 103 | - 'staff-directory', | |
| 104 | - 'tiered-pricing', | |
| 105 | - 'trip-itinerary', | |
| 106 | - 'twitterx', | |
| 107 | 86 | ); |
| 108 | 87 | } |
| 109 | 88 | |
| 110 | 89 | /** |
| 111 | 90 | * @param array $api_data |
| 112 | - * | |
| 113 | 91 | * @return void |
| 114 | 92 | */ |
| 115 | 93 | public function __construct( $api_data ) { |
| 116 | 94 | $this->api_data = $api_data; |
| @@ -121,9 +99,8 @@ | ||
| 121 | 99 | } |
| 122 | 100 | |
| 123 | 101 | /** |
| 124 | 102 | * @param array<string> $categories |
| 125 | - * | |
| 126 | 103 | * @return void |
| 127 | 104 | */ |
| 128 | 105 | private static function populate_category_information( $categories ) { |
| 129 | 106 | foreach ( $categories as $category ) { |
| @@ -129,9 +106,8 @@ | ||
| 129 | 106 | foreach ( $categories as $category ) { |
| 130 | 107 | if ( self::category_matches_a_license_type( $category ) ) { |
| 131 | 108 | continue; |
| 132 | 109 | } |
| 133 | - | |
| 134 | 110 | if ( in_array( $category, self::$categories, true ) ) { |
| 135 | 111 | continue; |
| 136 | 112 | } |
| 137 | 113 | self::$categories[] = $category; |
| @@ -141,9 +117,8 @@ | ||
| 141 | 117 | /** |
| 142 | 118 | * @since 5.5.2 |
| 143 | 119 | * |
| 144 | 120 | * @param string $category |
| 145 | - * | |
| 146 | 121 | * @return bool |
| 147 | 122 | */ |
| 148 | 123 | private static function category_matches_a_license_type( $category ) { |
| 149 | 124 | if ( false !== strpos( $category, '+Views' ) ) { |
| @@ -155,9 +130,9 @@ | ||
| 155 | 130 | /** |
| 156 | 131 | * @return array<string> |
| 157 | 132 | */ |
| 158 | 133 | public static function get_categories() { |
| 159 | - return self::$categories ?? array(); | |
| 134 | + return isset( self::$categories ) ? self::$categories : array(); | |
| 160 | 135 | } |
| 161 | 136 | |
| 162 | 137 | /** |
| 163 | 138 | * @return array |
| @@ -167,9 +142,8 @@ | ||
| 167 | 142 | return array(); |
| 168 | 143 | } |
| 169 | 144 | |
| 170 | 145 | $application = array(); |
| 171 | - | |
| 172 | 146 | foreach ( self::$keys as $key ) { |
| 173 | 147 | if ( ! isset( $this->api_data[ $key ] ) ) { |
| 174 | 148 | continue; |
| 175 | 149 | } |
| @@ -214,9 +188,8 @@ | ||
| 214 | 188 | return array(); |
| 215 | 189 | } |
| 216 | 190 | |
| 217 | 191 | $purchase_url = $this->is_available_for_purchase(); |
| 218 | - | |
| 219 | 192 | if ( false !== $purchase_url ) { |
| 220 | 193 | $application['forPurchase'] = true; |
| 221 | 194 | } |
| 222 | 195 | $application['upgradeUrl'] = $this->get_admin_upgrade_link(); |
| @@ -225,9 +198,8 @@ | ||
| 225 | 198 | |
| 226 | 199 | $application['isNew'] = $this->is_new(); |
| 227 | 200 | |
| 228 | 201 | $application['usedAddons'] = array(); |
| 229 | - | |
| 230 | 202 | if ( isset( $application['used_addons'] ) ) { |
| 231 | 203 | // Change key to camel case. |
| 232 | 204 | $application['usedAddons'] = $application['used_addons']; |
| 233 | 205 | unset( $application['used_addons'] ); |
| @@ -252,9 +224,8 @@ | ||
| 252 | 224 | return false; |
| 253 | 225 | } |
| 254 | 226 | |
| 255 | 227 | $pro = $addons[93790]; |
| 256 | - | |
| 257 | 228 | if ( ! array_key_exists( 'type', $pro ) ) { |
| 258 | 229 | return false; |
| 259 | 230 | } |
| 260 | 231 | |
| @@ -262,9 +233,8 @@ | ||
| 262 | 233 | $args = array( |
| 263 | 234 | 'license_type' => $license_type, |
| 264 | 235 | 'plan_required' => $this->get_required_license(), |
| 265 | 236 | ); |
| 266 | - | |
| 267 | 237 | if ( ! FrmFormsHelper::plan_is_allowed( $args ) ) { |
| 268 | 238 | return false; |
| 269 | 239 | } |
| 270 | 240 | |
| @@ -286,9 +256,8 @@ | ||
| 286 | 256 | * @return string |
| 287 | 257 | */ |
| 288 | 258 | private function get_required_license() { |
| 289 | 259 | $required_license = strtolower( $this->api_data['min_plan'] ); |
| 290 | - | |
| 291 | 260 | if ( 'plus' === $required_license ) { |
| 292 | 261 | $required_license = 'personal'; |
| 293 | 262 | } |
| 294 | 263 | return $required_license; |