public function pre_set_site_transient_update_themes($data)
 {
     //
     // Only run after other themes are checked.
     //
     if (empty($data->checked)) {
         return $data;
     }
     Themeco_Update_Api::refresh();
     $update_cache = Themeco_Update_Api::get_update_cache();
     if (!isset($update_cache['themes']) || !isset($update_cache['themes']['x'])) {
         return $data;
     }
     $themes = is_multisite() ? $this->multisite_get_themes() : wp_get_themes();
     if (isset($themes['x'])) {
         $remote = $update_cache['themes']['x'];
         if (version_compare($remote['new_version'], $themes['x']->get('Version'), '<=')) {
             return $data;
         }
         if (!$remote['package']) {
             $remote['new_version'] = $remote['new_version'] . '<br/>' . X_Update_API::get_validation_html_theme_updates();
         }
         $data->response['x'] = $remote;
     }
     return $data;
 }
 public function pre_set_site_transient_update_plugins($data)
 {
     //
     // Only run after other plugins are checked.
     //
     if (empty($data->checked)) {
         return $data;
     }
     Themeco_Update_Api::refresh();
     $update_cache = Themeco_Update_Api::get_update_cache();
     if (!isset($update_cache['plugins']) || empty($update_cache['plugins'])) {
         return $data;
     }
     include_once ABSPATH . '/wp-admin/includes/plugin.php';
     $installed_plugins = get_plugins();
     foreach ((array) $installed_plugins as $plugin_file => $local) {
         // Only check plugins in the Themeco update cache
         if (!isset($update_cache['plugins'][$plugin_file])) {
             continue;
         }
         $remote = $update_cache['plugins'][$plugin_file];
         // Version check
         if (version_compare($remote['new_version'], $local['Version'], '<=')) {
             continue;
         }
         if (!$remote['package']) {
             $remote['upgrade_notice'] = X_Update_API::get_validation_html_plugin_updates();
         }
         $data->response[$plugin_file] = (object) $remote;
     }
     return $data;
 }