EOF;
if (!empty($upload_dir['basedir'])) {
$file = $upload_dir['basedir'] . '/' . $orb_wp_simple_ui_obj->get('plugin_id_str') . '.cache.html';
// cache is good and hasn't expired yet. then use it.
if (file_exists($file) && (abs(time() - filemtime($file)) <= 24 * 3600)) {
$buff = Orbisius_WP_Admin_UI_SimplificatorUtil::read($file);
} else {
$params = array(
'plugin_id_str' => $orb_wp_simple_ui_obj->get('plugin_id_str'),
);
$service = new Orbisius_WP_Admin_UI_SimplificatorService('wp.get_content', $params);
if ($service->call()) { // cache the result and save it in the db
$data = $service->get_data();
$buff = $data['content'];
if (!empty($buff)) {
$buff .= " \n";
Orbisius_WP_Admin_UI_SimplificatorUtil::write($file, $buff);
}
}
}
}
$buff = empty($buff) ? $default_content : $buff;
echo $buff;