Beispiel #1
0
 /**
  * Get single instance of itself
  * 
  * @param AAM $parent
  * 
  * @return AAM_Core_Repository
  * 
  * @access public
  * @static
  */
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Beispiel #2
0
 /**
  * 
  */
 protected function checkExtensionList()
 {
     $list = AAM_Core_API::getOption('aam-extension-list', array());
     $repo = AAM_Core_Repository::getInstance();
     foreach ($list as $extension) {
         $status = $repo->extensionStatus($extension->title);
         if ($status == AAM_Core_Repository::STATUS_UPDATE) {
             AAM_Core_Console::add(sprintf(__('Extension %s has new update available for download.'), $extension->title));
         }
     }
 }
Beispiel #3
0
 /**
  * Initialize the AAM Object
  *
  * @return void
  *
  * @access protected
  */
 protected function __construct()
 {
     //initialize the user subject
     if (get_current_user_id()) {
         $this->setUser(new AAM_Core_Subject_User(get_current_user_id()));
     } else {
         $this->setUser(new AAM_Core_Subject_Visitor(''));
     }
     //load all installed extension
     AAM_Core_Repository::getInstance()->load();
     //bootstrap the correct interface
     if (is_admin()) {
         AAM_Backend_Manager::bootstrap();
     } else {
         AAM_Frontend_Manager::bootstrap();
     }
 }
Beispiel #4
0
 /**
  * Install an extension
  * 
  * @param string $storedLicense
  * 
  * @return string
  * 
  * @access public
  */
 public function install($storedLicense = null)
 {
     $repo = AAM_Core_Repository::getInstance();
     $license = AAM_Core_Request::post('license', $storedLicense);
     //download the extension from the server first
     $package = AAM_Core_Server::download($license);
     if (is_wp_error($package)) {
         $response = array('status' => 'failure', 'error' => $package->get_error_message());
     } elseif ($error = $repo->checkDirectory()) {
         $response = $this->installFailureResponse($error, $package);
         $this->storeLicense($package->title, $license);
     } else {
         //otherwise install the extension
         $result = $repo->addExtension(base64_decode($package->content));
         if (is_wp_error($result)) {
             $response = $this->installFailureResponse($result->get_error_message(), $package);
         } else {
             $response = array('status' => 'success');
         }
         $this->storeLicense($package->title, $license);
     }
     return json_encode($response);
 }
Beispiel #5
0
 /**
  * @todo Remove in Feb 2016
  */
 protected function checkRedundantExtensions()
 {
     $basedir = AAM_Core_Repository::getInstance()->getBasedir();
     //iterate through each active extension and load it
     if (file_exists($basedir)) {
         foreach (scandir($basedir) as $extension) {
             if (!in_array($extension, array('.', '..'))) {
                 if (!preg_match('/^[a-z]{1}[a-z\\-]+$/', $extension)) {
                     AAM_Core_Console::add(sprintf(AAM_Backend_Helper::preparePhrase('Please manually remove [%s] and re-install the extension if necessary', 'b'), $basedir . '/' . $extension));
                 }
             }
         }
     }
 }
 /**
  * 
  * @return type
  */
 public function getErrorFixStatus()
 {
     $plugin = AAM_Core_Repository::getInstance()->pluginStatus('WP Error Fix');
     if ($plugin['status'] == 'install') {
         $response = array('status' => 'show', 'url' => $plugin['url']);
     } else {
         $response = array('status' => 'hide');
     }
     return json_encode($response);
 }
 /**
  * 
  * @return int
  */
 protected static function getNotification()
 {
     $list = AAM_Core_API::getOption('aam-extension-repository', array());
     $repo = AAM_Core_Repository::getInstance();
     $count = 0;
     foreach ($list as $extension) {
         $status = $repo->extensionStatus($extension->title);
         if ($status == AAM_Core_Repository::STATUS_UPDATE) {
             $count++;
         }
     }
     return $count;
 }
Beispiel #8
0
<?php

/**
 * ======================================================================
 * LICENSE: This file is subject to the terms and conditions defined in *
 * file 'license.txt', which is part of this source code package.       *
 * ======================================================================
 */
return array(array('title' => 'AAM Plus Package', 'id' => 'AAM Plus Package', 'type' => 'commercial', 'cost' => '$30', 'currency' => 'USD', 'description' => __('Unlock limitations related to Posts and Pages feature. Extend basic AAM functionality with Page Categories and ability to manage access to your comments (AAM Plus Package adds new capabilities to the default list of WordPress capabilities like Edit Comments, Delete Comments, Spam Comments etc.)', AAM_KEY), 'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FGAHULDEFZV4U', 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Plus Package')), array('title' => 'AAM Role Filter', 'id' => 'AAM Role Filter', 'type' => 'commercial', 'cost' => '$5', 'currency' => 'USD', 'description' => __('Extension for more advanced user and role administration. Based on user\'s highest level capability, filter list of roles with higher level. Also prevent from editing, promoting or deleting higher level users.', AAM_KEY), 'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G9V4BT3T8WJSN', 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Role Filter')), array('title' => 'AAM Dev License', 'id' => 'AAM Development License', 'type' => 'commercial', 'cost' => '$150', 'currency' => 'USD', 'description' => __('Development license gives you an ability to download all the available extensions and use them to up to 5 life domains.', AAM_KEY), 'storeURL' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZX9RCWU6BTE52', 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Development License')), array('title' => 'AAM Utilities', 'id' => 'AAM Utilities', 'type' => 'GNU', 'license' => 'AAMUTILITIES', 'description' => __('Various useful tools for AAM like caching or clear all settings.', AAM_KEY), 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Utilities')), array('title' => 'AAM Multisite', 'id' => 'AAM Multisite', 'type' => 'GNU', 'license' => 'AAMMULTISITE', 'description' => __('Convenient way to navigate between different sites in the Network Admin Panel. This extension adds additional widget to the AAM page that allows to switch between different sites.', AAM_KEY), 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Multisite')), array('title' => 'AAM Post Filter', 'id' => 'AAM Post Filter', 'type' => 'GNU', 'license' => 'AAMPOSTFILTER', 'description' => AAM_Backend_Helper::preparePhrase('[WARNING!] Please use with caution. This is a supportive exension for the post access option [List]. It adds additional post filtering to fix the issue with large amount of post. [Turned on caching] is strongly recommended.', 'strong', 'strong', 'strong'), 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Post Filter')), array('title' => 'AAM Skeleton Extension', 'id' => 'AAM Skeleton Extension', 'type' => 'GNU', 'license' => 'SKELETONEXT', 'description' => __('Skeleton for custom AAM extension. Please find all necessary documentation inside the source code.', AAM_KEY), 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Skeleton Extension')), array('title' => 'User Switching', 'id' => 'User Switching', 'type' => 'plugin', 'description' => __('Instant switching between user accounts in WordPress. ', AAM_KEY), 'status' => AAM_Core_Repository::getInstance()->pluginStatus('User Switching')));