Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Easy Webinar Plugin 4.2.7 fix
- * Purpose: Caching latest version info for 6 hours to speedup execution (reduced 50% in our benchmarks)
- * EWP File: /wp-content/plugins/webinar_plugin/webinar-plugin.php
- * EWP method: getRemote_version()
- */
- public function getRemote_version() {
- if ( false === ( $request = get_transient( 'ewp_latest_version' ) ) ) {
- global $wpdb;
- $wpdb->webinar_license = 'webinar_license';
- $license_key_arr = $wpdb->get_results( "Select * FROM $wpdb->webinar_license" );
- $license_key = $license_key_arr[0]->key;
- $client_site = get_site_url();
- $request = wp_remote_post(
- $this->update_path,
- array(
- 'body' => array(
- 'action' => 'ewp-version',
- 'license_series' => $license_key,
- 'client_site' => $client_site,
- ),
- )
- );
- if ( ! is_wp_error( $request ) || 200 === wp_remote_retrieve_response_code( $request ) ) {
- set_transient( 'ewp_latest_version', $request['body'], 6 * HOUR_IN_SECONDS );
- return $request['body'];
- } else {
- echo 'heena';
- }
- } else {
- return $request;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement