| @@ -145,9 +145,9 @@ | ||
| 145 | 145 | * |
| 146 | 146 | * @return bool |
| 147 | 147 | */ |
| 148 | 148 | private static function category_matches_a_license_type( $category ) { |
| 149 | - if ( false !== strpos( $category, '+Views' ) ) { | |
| 149 | + if ( str_contains( $category, '+Views' ) ) { | |
| 150 | 150 | return true; |
| 151 | 151 | } |
| 152 | 152 | return in_array( $category, FrmFormsHelper::get_license_types(), true ); |
| 153 | 153 | } |
| @@ -183,9 +183,9 @@ | ||
| 183 | 183 | $application[ $key ] = array_values( |
| 184 | 184 | array_filter( |
| 185 | 185 | $value, |
| 186 | 186 | function ( $category ) { |
| 187 | - return false === strpos( $category, '+Views' ); | |
| 187 | + return ! str_contains( $category, '+Views' ); | |
| 188 | 188 | } |
| 189 | 189 | ) |
| 190 | 190 | ); |
| 191 | 191 | } else { |
| @@ -194,12 +194,13 @@ | ||
| 194 | 194 | } elseif ( 'forms' === $key ) { |
| 195 | 195 | $key = 'formCount'; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - if ( 'name' === $key && ' Template' === substr( $value, -9 ) ) { | |
| 198 | + if ( 'name' === $key && str_ends_with( $value, ' Template' ) ) { | |
| 199 | 199 | // Strip off the " Template" text at the end of the name as it takes up space. |
| 200 | 200 | $value = substr( $value, 0, -9 ); |
| 201 | 201 | } |
| 202 | + | |
| 202 | 203 | $application[ $key ] = $value; |
| 203 | 204 | }//end if |
| 204 | 205 | }//end foreach |
| 205 | 206 | |
| @@ -218,8 +219,9 @@ | ||
| 218 | 219 | |
| 219 | 220 | if ( false !== $purchase_url ) { |
| 220 | 221 | $application['forPurchase'] = true; |
| 221 | 222 | } |
| 223 | + | |
| 222 | 224 | $application['upgradeUrl'] = $this->get_admin_upgrade_link(); |
| 223 | 225 | $application['link'] = $application['upgradeUrl']; |
| 224 | 226 | } |
| 225 | 227 | |
| @@ -262,14 +264,9 @@ | ||
| 262 | 264 | $args = array( |
| 263 | 265 | 'license_type' => $license_type, |
| 264 | 266 | 'plan_required' => $this->get_required_license(), |
| 265 | 267 | ); |
| 266 | - | |
| 267 | - if ( ! FrmFormsHelper::plan_is_allowed( $args ) ) { | |
| 268 | - return false; | |
| 269 | - } | |
| 270 | - | |
| 271 | - return true; | |
| 268 | + return FrmFormsHelper::plan_is_allowed( $args ); | |
| 272 | 269 | } |
| 273 | 270 | |
| 274 | 271 | /** |
| 275 | 272 | * Check if an application template is new. If it is, we include a "NEW" pill beside the title. |
| @@ -286,13 +283,9 @@ | ||
| 286 | 283 | * @return string |
| 287 | 284 | */ |
| 288 | 285 | private function get_required_license() { |
| 289 | 286 | $required_license = strtolower( $this->api_data['min_plan'] ); |
| 290 | - | |
| 291 | - if ( 'plus' === $required_license ) { | |
| 292 | - $required_license = 'personal'; | |
| 293 | - } | |
| 294 | - return $required_license; | |
| 287 | + return 'plus' === $required_license ? 'personal' : $required_license; | |
| 295 | 288 | } |
| 296 | 289 | |
| 297 | 290 | /** |
| 298 | 291 | * @return string |