 pronamic    /
                    wp-pronamic-ideal
                      pronamic    /
                    wp-pronamic-ideal
                
                            | 1 | <?php | ||||
| 2 | /** | ||||
| 3 | * Update 3.3.0 | ||||
| 4 | * | ||||
| 5 | * @author Pronamic <[email protected]> | ||||
| 6 | * @copyright 2005-2019 Pronamic | ||||
| 7 | * @license GPL-3.0-or-later | ||||
| 8 | * @package Pronamic\WordPress\Pay | ||||
| 9 | */ | ||||
| 10 | |||||
| 11 | /** | ||||
| 12 | * Execute changes made in Pronamic Pay 3.3.0 | ||||
| 13 | * | ||||
| 14 | * @link https://github.com/WordPress/WordPress/blob/3.5.1/wp-admin/includes/upgrade.php#L413 | ||||
| 15 | * @since 3.3.0 | ||||
| 16 | */ | ||||
| 17 | |||||
| 18 | $license_md5 = get_option( 'pronamic_pay_license_key' ); | ||||
| 19 | |||||
| 20 | $url = add_query_arg( 'license', $license_md5, 'http://api.pronamic.eu/licenses/convert-md5/1.0/' ); | ||||
| 21 | |||||
| 22 | $result = wp_remote_get( $url ); | ||||
| 23 | |||||
| 24 | if ( 200 === wp_remote_retrieve_response_code( $result ) ) { | ||||
| 0 ignored issues–
                            show             Bug
    
    
    
        introduced 
                            by  
  Loading history... | |||||
| 25 | $body = wp_remote_retrieve_body( $result ); | ||||
| 0 ignored issues–
                            show It seems like  $resultcan also be of typeWP_Error; however, parameter$responseofwp_remote_retrieve_body()does only seem to acceptarray, maybe add an additional type check?
                                                                                                                                                                                           (
                                     Ignorable by Annotation
                                ) If this is a false-positive, you can also ignore this issue in your code via the  
  Loading history... | |||||
| 26 | |||||
| 27 | 	if ( 32 === strlen( $body ) ) { | ||||
| 28 | update_option( 'pronamic_pay_license_key', $body ); | ||||
| 29 | } | ||||
| 30 | } | ||||
| 31 | 
