| @@ -102,9 +102,9 @@ | ||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * Updates information on the "View version 6.15 details" page with custom data. | |
| 106 | + * Updates information on the "View version x.x details" page with custom data. | |
| 107 | 107 | * |
| 108 | 108 | * @uses api_request() |
| 109 | 109 | * |
| 110 | 110 | * @param mixed $_data |
| @@ -214,11 +214,11 @@ | ||
| 214 | 214 | * |
| 215 | 215 | * @since 2.04 |
| 216 | 216 | */ |
| 217 | 217 | public function get_defined_license() { |
| 218 | - $constant_name = 'FRM_' . strtoupper( $this->plugin_slug ) . '_LICENSE'; | |
| 218 | + $consant_name = 'FRM_' . strtoupper( $this->plugin_slug ) . '_LICENSE'; | |
| 219 | 219 | |
| 220 | - return defined( $constant_name ) ? constant( $constant_name ) : false; | |
| 220 | + return defined( $consant_name ) ? constant( $consant_name ) : false; | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | public function set_license( $license ) { |
| 224 | 224 | update_option( $this->option_name . 'key', $license ); |
| @@ -295,9 +295,9 @@ | ||
| 295 | 295 | $caps = FrmAppHelper::frm_capabilities( 'pro_only' ); |
| 296 | 296 | $roles = get_editable_roles(); |
| 297 | 297 | $settings = new FrmSettings(); |
| 298 | 298 | foreach ( $caps as $cap => $cap_desc ) { |
| 299 | - $cap_roles = (array) ( $settings->$cap ?? 'administrator' ); | |
| 299 | + $cap_roles = (array) ( isset( $settings->$cap ) ? $settings->$cap : 'administrator' ); | |
| 300 | 300 | |
| 301 | 301 | // Make sure administrators always have permissions. |
| 302 | 302 | if ( ! in_array( 'administrator', $cap_roles, true ) ) { |
| 303 | 303 | array_push( $cap_roles, 'administrator' ); |
| @@ -329,11 +329,8 @@ | ||
| 329 | 329 | $api->reset_cached(); |
| 330 | 330 | |
| 331 | 331 | $api = new FrmApplicationApi( $this->license ); |
| 332 | 332 | $api->reset_cached(); |
| 333 | - | |
| 334 | - $api = new FrmSalesApi(); | |
| 335 | - $api->reset_cached(); | |
| 336 | 333 | } |
| 337 | 334 | |
| 338 | 335 | /** |
| 339 | 336 | * The Pro version includes the show_license_message function. |
| @@ -370,9 +367,9 @@ | ||
| 370 | 367 | $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); |
| 371 | 368 | $id = sanitize_title( $plugin['Name'] ) . '-next'; |
| 372 | 369 | |
| 373 | 370 | echo '<tr class="plugin-update-tr active" id="' . esc_attr( $id ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message notice error inline notice-error notice-alt"><p>'; |
| 374 | - FrmAppHelper::kses_echo( $message, 'a' ); | |
| 371 | + echo FrmAppHelper::kses( $message, 'a' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 375 | 372 | echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '").previousSibling;if ( d !== null ){ d.className = d.className + " update"; }</script>'; |
| 376 | 373 | echo '</p></div></td></tr>'; |
| 377 | 374 | } |
| 378 | 375 | |
| @@ -551,9 +548,9 @@ | ||
| 551 | 548 | // If the last check was invalid, we don't need to check again. |
| 552 | 549 | return true; |
| 553 | 550 | } |
| 554 | 551 | |
| 555 | - $checked_time = $last_checked['time'] ?? false; | |
| 552 | + $checked_time = isset( $last_checked['time'] ) ? $last_checked['time'] : false; | |
| 556 | 553 | $time_ago = gmdate( 'Y-m-d H:i:s', strtotime( '-' . $time ) ); |
| 557 | 554 | return $checked_time && $checked_time > $time_ago; |
| 558 | 555 | } |
| 559 | 556 | |
| @@ -610,10 +607,8 @@ | ||
| 610 | 607 | |
| 611 | 608 | $plugin_slug = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' ); |
| 612 | 609 | $response = self::activate_license_for_plugin( $license, $plugin_slug ); |
| 613 | 610 | |
| 614 | - FrmInbox::clear_cache(); | |
| 615 | - | |
| 616 | 611 | wp_send_json( $response ); |
| 617 | 612 | } |
| 618 | 613 | |
| 619 | 614 | /** |
| @@ -764,9 +759,8 @@ | ||
| 764 | 759 | $response['message'] = $e->getMessage(); |
| 765 | 760 | } |
| 766 | 761 | |
| 767 | 762 | $this_plugin->clear_license(); |
| 768 | - FrmInbox::clear_cache(); | |
| 769 | 763 | |
| 770 | 764 | wp_send_json( $response ); |
| 771 | 765 | } |
| 772 | 766 | |