{"id":1152,"date":"2015-10-31T12:45:59","date_gmt":"2015-10-31T10:45:59","guid":{"rendered":"https:\/\/urosevic.net\/wordpress\/?p=1152"},"modified":"2026-03-10T16:50:50","modified_gmt":"2026-03-10T15:50:50","slug":"how-to-speed-up-easy-webinar-plugin","status":"publish","type":"post","link":"https:\/\/urosevic.net\/wordpress\/tips\/how-to-speed-up-easy-webinar-plugin\/","title":{"rendered":"Easy Webinar Plugin on Steroids"},"content":{"rendered":"\n<p>If you already use Easy Webinar Plugin (4.2.7 or older) within your WordPress website, you probably notice a kind of slow dashboard.<\/p>\n\n\n\n<p>In this article, you can learn\u00a0how to speed up EWP with a\u00a0piece of code snippet. All you need to have is basic knowledge of PHP editing, and FTP access to website host.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4 Simple Steps<\/h2>\n\n\n\n<p><strong>Step One<\/strong>:\u00a0Go to FTP where you have installed the WordPress website and backup file\u00a0<strong>\/wp-content\/plugins\/webinar_plugin\/webinar-plugin.php<\/strong><\/p>\n\n\n\n<p><strong>Step Two<\/strong>: Open file\u00a0<strong>\/wp-content\/plugins\/webinar_plugin\/webinar-plugin.php<\/strong> in some text editor (even Notepad can help, but I recommend <a href=\"http:\/\/www.sublimetext.com\/3\" target=\"_blank\" rel=\"noopener\">Sublime Text 3<\/a>).<\/p>\n\n\n\n<p><strong>Step Three<\/strong>: Find method getRemote_version() which is located at line 939 in plugin version EWP(4.2.7)<\/p>\n\n\n\n<p><strong>Step Four<\/strong>: Replace the complete original function <code>getRemote_version()<\/code> with a cacheable version.\u00a0So this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function getRemote_version(){\n  global $wpdb;\n  $wpdb->webinar_license = \"webinar_license\";\n  $license_key_arr = $wpdb->get_results(\"Select * FROM $wpdb->webinar_license\");\n  $license_key = $license_key_arr&#91;0]->key;\n  $client_site = get_site_url();\n  $request = wp_remote_post($this->update_path, array('body' => array('action' => 'ewp-version','license_series' => $license_key,'client_site' => $client_site)));\n  \n  if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200){\n    return $request&#91;'body'];\n  }\n  else {\n    echo 'heena';\n  }\n  return false;\n}<\/code><\/pre>\n\n\n\n<p>becomes this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function getRemote_version() {\n  if ( false === ( $request = get_transient( 'ewp_latest_version' ) ) ) {\n    global $wpdb;\n    $wpdb->webinar_license = 'webinar_license';\n    $license_key_arr = $wpdb->get_results( \"SELECT * FROM $wpdb->webinar_license\" );\n    $license_key = $license_key_arr&#91;0]->key;\n    $client_site = get_site_url();\n    $request = wp_remote_post(\n      $this->update_path,\n      array(\n        'body' => array(\n          'action'         => 'ewp-version',\n          'license_series' => $license_key,\n          'client_site'    => $client_site,\n        ),\n      )\n    );\n\n    if ( ! is_wp_error( $request ) || 200 === wp_remote_retrieve_response_code( $request ) ) {\n      set_transient( 'ewp_latest_version', $request&#91;'body'], 6 * HOUR_IN_SECONDS );\n      return $request&#91;'body'];\n    } else {\n      echo 'heena';\n    }\n  } else {\n    return $request;\n  }\n  return false;\n}<\/code><\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation of code<\/h3>\n\n\n\n<p>By default, EWP does multiple checks for the latest version of the plugin by calling the home (remote) server to get the latest version number. This can slow down code execution (waiting response from\u00a0a remote server, multiplied by numerous calls per single page load). My idea was\u00a0to prevent this and optimize calls, by involving the local WordPress cache for\u00a0the plugin&#8217;s latest version data, through <a href=\"https:\/\/codex.wordpress.org\/Transients_API\" target=\"_blank\" rel=\"noopener\">Transients API<\/a>.<\/p>\n\n\n\n<p>A new plugin version can&#8217;t be released on each second, minute, or even hour. Because of that, 1+ remote call per page load is a waste of bandwidth and time. So\u00a0we can, for a while, locally store the latest version number fetched from the remote server and simply check local data on the same page loads.<\/p>\n\n\n\n<p>In this tweak, I store the latest version info for 6 hours. Simple as that.<\/p>\n\n\n\n<p>Please note, that Easy Webinar support confirmed that they&#8217;ll apply this enhancement to\u00a0upcoming releases.\u00a0I&#8217;m expecting EWP(4.2.8) to come with a fix already implemented. If not, simply refactor my version of the method <code>getRemote_version()<\/code> and tweak the core plugin file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you already use Easy Webinar Plugin within your WordPress website, and\u00a0you are on EWP version 4.2.7 or older, you probably noticed kind of slow dashboard. In this article you can learn how to achieve speed up with single code snippet.<\/p>\n","protected":false},"author":1,"featured_media":1169,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[39,43,36,40,38,42,41],"class_list":["post-1152","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","tag-code-snippet","tag-easy-webinar-plugin","tag-easywebinar","tag-enhancement","tag-ewp","tag-latest-version","tag-transient"],"_links":{"self":[{"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/posts\/1152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/comments?post=1152"}],"version-history":[{"count":23,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/posts\/1152\/revisions"}],"predecessor-version":[{"id":3019,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/posts\/1152\/revisions\/3019"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/media\/1169"}],"wp:attachment":[{"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/media?parent=1152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/categories?post=1152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/urosevic.net\/wordpress\/wp-json\/wp\/v2\/tags?post=1152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}