function get_plugin_version($author) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; if ($author !== '') { $plugin_author = $author; } else { $plugin_author = '*'; } $plugins = get_plugins(); $plugins_allowedtags1 = array('a' => array('href' => array(), 'title' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'em' => array(), 'strong' => array()); foreach ($plugins as $plugin_file => $plugin_data) { $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags1); $plugin_data['Title'] = $plugin_data['PluginURI'] ? '<a href="' . $plugin_data['PluginURI'] . '">' . $plugin_data['Title'] . '</a>' : $plugin_data['Title']; $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags1); $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags1); $plugin_data['Author'] = empty($plugin_data['Author']) ? '' : ' <cite>' . sprintf(__('%s', 'wp-list-plugins'), $plugin_data['AuthorURI'] ? '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>' : $plugin_data['Author']) . '.</cite>'; $local_version = $plugin_data['Version']; // $local_version='0.5'; if (strpos($plugin_data['Author'], $plugin_author) == true || strpos($plugin_data['Name'], 'Rob') == true || $author == '') { $var_sHtml .= "<li>{$plugin_data['Title']} (v. {$plugin_data['Version']} ) By {$plugin_data['Author']}.</li>"; $p_arr = explode("/", $plugin_file); $p_file = $p_arr[0]; compare_versions($p_file, $local_version); } $var_iPlugInNumber++; } if (is_admin()) { echo $var_sHtml; } return $var_sHtml; }
function get_theme_versions($theme_name) { for ($i = 0; $i < count($theme_name); $i++) { $theme_data = get_theme_data(get_theme_root() . '/' . $theme_name[$i] . '/style.css'); $local_version = $theme_data['Version']; // $local_version='0.5'; if ($theme_data['Author'] == get_option('check_my_version_theme') || get_option('check_my_version_theme') == '') { $var_sHtml .= "<li>{$theme_data['Title']} (v. {$theme_data['Version']} ) By {$theme_data['Author']}.</li>"; compare_versions($theme_name[$i], $local_version); } } if (is_admin()) { echo $var_sHtml; } return $var_sHtml; }
function get_cache($hour = 24, $daily = 0, $cache_type = "0", $cache_name = "0", $cache_parameter = "0") { global $db, $table_prefix; $current_version = va_version(); if (compare_versions($current_version, "3.6.32") == 2) { return array(0); } $sql = " SELECT * FROM " . $table_prefix . "caches WHERE cache_type = " . $db->tosql($cache_type, TEXT); $sql .= " AND cache_name = " . $db->tosql($cache_name, TEXT); $sql .= " AND cache_parameter = " . $db->tosql($cache_parameter, TEXT); $db->query($sql); if ($db->next_record()) { $date = $db->f("cache_date"); if (!$daily) { if (strtotime($date) + $hour * 60 * 60 > strtotime(date("Y-m-d H:i:s"))) { return $db->f("cache_data"); } else { return array(1); } } else { if (strtotime(date("Y-m-d") . " 00:00:00") < strtotime($date) + 24 * 60 * 60) { return $db->f("cache_data"); } else { return array(1); } } } return array(0); }