Example #1
0
 /**
  * Constructor.
  * @since  1.0.0
  */
 public function __construct()
 {
     global $status, $page;
     $this->mixed_array = array();
     $args = array('singular' => 'license', 'plural' => 'licenses', 'ajax' => false);
     $this->data = array();
     // Make sure this file is loaded, so we have access to plugins_api(), etc.
     require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
     global $storeapi;
     if (class_exists('EditorStoreFront')) {
         if (!is_object($storeapi)) {
             $storeapi = new EditorStoreFront();
         }
         $this->mixed_array = $storeapi->get_latest();
     }
     parent::__construct($args);
 }
Example #2
0
 function check_info($false, $action, $arg)
 {
     global $storeapi;
     if (!is_object($storeapi)) {
         $storeapi = new EditorStoreFront();
     }
     $mixed_array = $storeapi->get_latest();
     if (is_object($arg) && isset($arg->slug) && isset($mixed_array[$arg->slug])) {
         $data = $mixed_array[$arg->slug];
         $obj = new stdClass();
         $obj->slug = $data['slug'];
         $obj->plugin_name = $data['name'];
         $obj->name = $data['name'];
         $obj->new_version = $data['version'];
         $obj->requires = '3.8';
         $obj->tested = '4.1';
         $obj->downloaded = 0;
         // needs API update....
         $obj->last_updated = $data['last_mod'];
         $obj->sections = array('description' => $this->build_desc($data), 'changelog' => $this->build_logs($data));
         $obj->homepage = $data['overview'];
         return $obj;
     }
     return false;
 }
Example #3
0
 function register_plugins()
 {
     global $updater_main;
     if (!class_exists('EditorStoreFront')) {
         return array();
     }
     $plugins = array();
     global $storeapi;
     if (!is_object($storeapi)) {
         $storeapi = new EditorStoreFront();
     }
     $mixed_array = $storeapi->get_latest();
     $plugins_all = $updater_main->get_pl_plugins();
     foreach ($plugins_all as $path => $data) {
         $slug = dirname($path);
         if (isset($mixed_array[$slug]) && $mixed_array[$slug]['version'] > $data['Version'] || isset($mixed_array[$slug]) && defined('PL_UPDATER_SHOW_ALL')) {
             // plugin has data, so lets show it.
             $plugins[$slug] = array('type' => 'plugin', 'product_file_path' => $slug, 'product_name' => $data['Plugin Name'], 'product_version' => $data['Version'], 'product_desc' => $data['Description'], 'product_update' => $mixed_array[$slug]['version'] > $data['Version'] ? true : false);
         }
     }
     return $plugins;
 }
Example #4
0
/**
 *  Search the store.
 *
 *	@since 3.0
 */
function pl_store_search($string)
{
    global $storeapi;
    if (!is_object($storeapi)) {
        $storeapi = new EditorStoreFront();
    }
    return $storeapi->api_search($string, $storeapi->get_latest());
}