Plugin Directory

Changeset 3308206


Ignore:
Timestamp:
06/09/2025 12:27:44 AM (10 months ago)
Author:
vasyltech
Message:

Official 7.0.5

Location:
advanced-access-manager
Files:
327 added
14 edited

Legend:

Unmodified
Added
Removed
  • advanced-access-manager/trunk/aam.php

    r3304543 r3308206  
    44 * Plugin Name: Advanced Access Manager
    55 * Description: Powerfully robust WordPress plugin designed to help you control every aspect of your website, your way.
    6  * Version: 7.0.4
     6 * Version: 7.0.5
    77 * Author: VasylTech LLC <support@aamplugin.com>
    88 * Author URI: https://aamportal.com
     
    147147     * @access public
    148148     *
    149      * @version 7.0.2
     149     * @version 7.0.5
    150150     */
    151151    public static function on_plugins_loaded()
    152152    {
    153         // Load AAM
    154         self::get_instance();
    155 
    156153        // Load all the defined AAM services
    157154        foreach(self::SERVICES as $service_class => $flag) {
     
    288285    define('AAM_MEDIA', plugins_url('/media', __FILE__));
    289286    define('AAM_KEY', 'advanced-access-manager');
    290     define('AAM_VERSION', '7.0.4');
     287    define('AAM_VERSION', '7.0.5');
    291288    define('AAM_BASEDIR', __DIR__);
    292289
     
    298295    AAM_Autoloader::register();
    299296
     297    // Initialize AAM
     298    AAM::get_instance();
     299
    300300    // Load AAM service and register all the necessary initializations
    301     add_action('plugins_loaded', 'AAM::on_plugins_loaded');
     301    add_action('plugins_loaded', 'AAM::on_plugins_loaded', -9999);
    302302    add_action('init', 'AAM::on_init');
    303303
  • advanced-access-manager/trunk/application/Addon/Repository.php

    r3304543 r3308206  
    3232     * Note! This is the latest version at the time of AAM publishing
    3333     *
    34      * @version 7.0.4
     34     * @version 7.0.5
    3535     */
    36     const LATEST_PREMIUM_VERSION = '7.0.3';
     36    const LATEST_PREMIUM_VERSION = '7.0.4';
    3737
    3838    /**
  • advanced-access-manager/trunk/application/Framework/Preference/AccessDeniedRedirect.php

    r3286780 r3308206  
    1515 */
    1616class AAM_Framework_Preference_AccessDeniedRedirect
    17 implements AAM_Framework_Preference_Interface, ArrayAccess
     17implements AAM_Framework_Preference_Interface
    1818{
    1919
  • advanced-access-manager/trunk/application/Framework/Preference/BaseTrait.php

    r3286780 r3308206  
    198198
    199199    /**
    200      * Set an individual preference value
    201      *
    202      * @param string $offset
    203      * @param mixed  $value
    204      *
    205      * @return void
    206      * @access public
    207      *
    208      * @version 7.0.0
    209      */
    210     #[ReturnTypeWillChange]
    211     public function offsetSet($offset, $value)
    212     {
    213         $this->_explicit_preferences[$offset] = $value;
    214 
    215         $this->_save($this->_explicit_preferences);
    216     }
    217 
    218     /**
    219      * Remove an individual preference property
    220      *
    221      * @param string $offset
    222      *
    223      * @return void
    224      * @access public
    225      *
    226      * @version 7.0.0
    227      */
    228     #[ReturnTypeWillChange]
    229     public function offsetUnset($offset)
    230     {
    231         if (array_key_exists($offset, $this->_explicit_preferences)) {
    232             unset($this->_explicit_preferences[$offset]);
    233 
    234             $this->_save($this->_explicit_preferences);
    235         }
    236     }
    237 
    238     /**
    239      * Check if preference exists
    240      *
    241      * @param string $offset
    242      *
    243      * @return bool
    244      * @access public
    245      *
    246      * @version 7.0.0
    247      */
    248     #[ReturnTypeWillChange]
    249     public function offsetExists($offset)
    250     {
    251         return array_key_exists($offset, $this->_preferences);
    252     }
    253 
    254     /**
    255      * Get a single preference
    256      *
    257      * @param string $offset
    258      *
    259      * @return mixed
    260      * @access public
    261      *
    262      * @version 7.0.0
    263      */
    264     #[ReturnTypeWillChange]
    265     public function offsetGet($offset)
    266     {
    267         if ($this->offsetExists($offset)) {
    268             $result = $this->_preferences[$offset];
    269         } else {
    270             $result = null;
    271         }
    272 
    273         return $result;
    274     }
    275 
    276     /**
    277200     * Initialize preferences
    278201     *
  • advanced-access-manager/trunk/application/Framework/Service/AccessDeniedRedirect.php

    r3286780 r3308206  
    135135     * @access public
    136136     *
    137      * @version 7.0.0
     137     * @version 7.0.5
    138138     */
    139139    public function reset($area = null)
     
    146146                $result = $container->reset();
    147147            } else {
    148                 if ($container[$area]) {
    149                     unset($container[$area]);
     148                $preferences = $container->get_preferences();
     149
     150                if (isset($preferences[$area])) {
     151                    unset($preferences[$area]);
     152
     153                    $container->set_preferences($preferences);
    150154                }
    151155            }
  • advanced-access-manager/trunk/application/Framework/Service/Jwts.php

    r3296450 r3308206  
    163163            ], $settings);
    164164
    165 
    166165            if (is_numeric($config['ttl'])) {
    167166                $config['ttl'] = "+{$settings['ttl']} seconds";
  • advanced-access-manager/trunk/application/Framework/Service/Policies.php

    r3286780 r3308206  
    590590     *
    591591     * @return AAM_Framework_Resource_Policy
    592      *
    593      * @access private
     592     * @access private
     593     *
    594594     * @version 7.0.0
    595595     */
     
    609609     * @access private
    610610     *
    611      * @version 7.0.0
     611     * @version 7.0.5
    612612     */
    613613    private function _parse_policy($policy)
     
    622622
    623623        // Do not load the policy if any errors
    624         if (json_last_error() === JSON_ERROR_NONE) {
     624        if (json_last_error() === JSON_ERROR_NONE && is_array($raw)) {
    625625            $result = [
    626626                'Statement' => $this->_get_array_of_arrays($raw, 'Statement'),
     
    633633            _doing_it_wrong(
    634634                __CLASS__ . '::' . __METHOD__,
    635                 sprintf(
    636                     'Access policy %d error %s', $policy->ID, json_last_error_msg()
    637                 ),
     635                sprintf('Invalid access policy (ID: %d)', $policy->ID),
    638636                AAM_VERSION
    639637            );
  • advanced-access-manager/trunk/application/Framework/Service/PostTypes.php

    r3286780 r3308206  
    1010/**
    1111 * Post Types framework service
     12 *
     13 * @method bool is_hidden_on(string|WP_Post_Type $post_type, string $website_area) **[Premium Feature]**
     14 * @method bool is_hidden(string|WP_Post_Type $post_type) **[Premium Feature]**
     15 * @method bool is_password_protected(string|WP_Post_Type $post_type) **[Premium Feature]**
     16 * @method bool is_restricted(string|WP_Post_Type $post_type) **[Premium Feature]**
     17 * @method bool is_redirected(string|WP_Post_Type $post_type) **[Premium Feature]**
     18 * @method bool is_teaser_message_set(string|WP_Post_Type $post_type) **[Premium Feature]**
     19 * @method bool is_denied_to(string|WP_Post_Type $post_type, string $permission) **[Premium Feature]**
     20 * @method bool is_allowed_to(string|WP_Post_Type $post_type, string $permission) **[Premium Feature]**
     21 * @method bool is_access_expired(string|WP_Post_Type $post_type, string $permission) **[Premium Feature]**
     22 * @method bool set_password(string|WP_Post_Type $post_type, string $password, bool $exclude_authors = false) **[Premium Feature]**
     23 * @method bool set_teaser_message(string|WP_Post_Type $post_type, string $message, bool $exclude_authors = false) **[Premium Feature]**
     24 * @method bool set_redirect(string|WP_Post_Type $post_type, array $redirect, bool $exclude_authors = false) **[Premium Feature]**
     25 * @method bool set_expiration(string|WP_Post_Type $post_type, int $timestamp, bool $exclude_authors = false) **[Premium Feature]**
     26 * @method bool deny(string|WP_Post_Type $post_type, string|array $permission, bool $exclude_authors = false) **[Premium Feature]**
     27 * @method bool allow(string|WP_Post_Type $post_type, string|array $permission, bool $exclude_authors = false) **[Premium Feature]**
     28 * @method bool hide(string|WP_Post_Type $post_type, string|array $website_area = null, bool $exclude_authors = false) **[Premium Feature]**
     29 * @method bool show(string|WP_Post_Type $post_type, string|array $website_area = null) **[Premium Feature]**
     30 * @method string|null get_password(string|WP_Post_Type $post_type) **[Premium Feature]**
     31 * @method string|null get_teaser_message(string|WP_Post_Type $post_type) **[Premium Feature]**
     32 * @method array|null get_redirect(string|WP_Post_Type $post_type) **[Premium Feature]**
     33 * @method int|null get_expiration(string|WP_Post_Type $post_type) **[Premium Feature]**
    1234 *
    1335 * @package AAM
  • advanced-access-manager/trunk/application/Framework/Service/Posts.php

    r3286780 r3308206  
    651651            $resource   = $this->_get_resource();
    652652            $identifier = $this->_normalize_resource_identifier($post_identifier);
    653             $permission = [
    654                 'effect' => 'deny'
    655             ];
     653            $permission = [ 'effect' => 'deny' ];
    656654
    657655            // Determine the list of areas for list permission
     
    685683     * @access public
    686684     *
    687      * @version 7.0.0
     685     * @version 7.0.5
    688686     */
    689687    public function show($post_identifier, $website_area = null)
     
    692690            $resource   = $this->_get_resource($post_identifier);
    693691            $identifier = $this->_normalize_resource_identifier($post_identifier);
    694             $permission = [
    695                 'effect' => 'deny'
    696             ];
     692            $permission = [ 'effect' => 'allow' ];
    697693
    698694            // Determine the list of areas for list permission
    699695            if (is_string($website_area)) {
    700                 $on = [ trim($website_area) ];
     696                $permission['on'] = [ trim($website_area) ];
    701697            } elseif (is_array($website_area)) {
    702                 $on = array_map('trim', $website_area);
    703             } else {
    704                 $on = null;
    705             }
    706 
    707             if (is_null($on) || count($on) === 3) {
    708                 $result = $resource->remove_permission($identifier, 'list');
    709             } else {
    710                 $permission['on'] = array_diff(
    711                     [ 'frontend', 'backend', 'api' ], $on
    712                 );
    713 
    714                 $result = $resource->set_permission(
    715                     $identifier, 'list', $permission
    716                 );
    717             }
     698                $permission['on'] = array_map('trim', $website_area);
     699            }
     700
     701            $result = $resource->set_permission(
     702                $identifier, 'list', $permission
     703            );
    718704        } catch (Exception $e) {
    719705            $result = $this->_handle_error($e);
  • advanced-access-manager/trunk/application/Framework/Service/Taxonomies.php

    r3286780 r3308206  
    1010/**
    1111 * Taxonomies framework service
     12 *
     13 * @method bool is_hidden_on(mixed $resource_identifier, string $website_area) **[Premium Feature]**
     14 * @method bool is_hidden(mixed $resource_identifier) **[Premium Feature]**
     15 * @method bool is_denied_to(mixed $resource_identifier, string $permission) **[Premium Feature]**
     16 * @method bool is_allowed_to(mixed $resource_identifier, string $permission) **[Premium Feature]**
     17 * @method bool deny(mixed $resource_identifier, string|array $permission) **[Premium Feature]**
     18 * @method bool allow(mixed $resource_identifier, string|array $permission) **[Premium Feature]**
     19 * @method bool hide(mixed $resource_identifier, string|array $website_area = null) **[Premium Feature]**
     20 * @method bool show(mixed $resource_identifier, string|array $website_area = null) **[Premium Feature]**
    1221 *
    1322 * @package AAM
  • advanced-access-manager/trunk/application/Framework/Service/Terms.php

    r3286780 r3308206  
    1111 * Terms framework service
    1212 *
    13  * @method urls(mixed $access_level = null, array $settings = []) **[Premium Feature]**
    1413 * @method bool is_hidden_on(mixed $resource_identifier, string $website_area) **[Premium Feature]**
    1514 * @method bool is_hidden(mixed $resource_identifier) **[Premium Feature]**
  • advanced-access-manager/trunk/application/Restful/Content.php

    r3286780 r3308206  
    635635     * @access private
    636636     *
    637      * @version 7.0.0
     637     * @version 7.0.5
    638638     */
    639639    private function _prepare_term_output($access_level, $term)
     
    650650        ];
    651651
    652         if (!empty($post_type_scope)) {
     652        if (!empty($term->post_type)) {
    653653            $is_default = $term->taxonomy === 'category'
    654654                && intval(get_option('default_category')) === $term->term_id;
     
    659659
    660660            // Also adding post type scope to the output
    661             $result['post_type'] = $post_type_scope;
     661            $result['post_type'] = $term->post_type;
    662662        }
    663663
  • advanced-access-manager/trunk/application/Service/Core.php

    r3304543 r3308206  
    8080        }, 10, 2);
    8181
     82        // Hook into AAM config initialization and enrich it with ConfigPress
     83        // settings
     84        add_filter('aam_init_config_filter', function($configs) {
     85            return $this->_aam_initialize_config($configs);
     86        });
     87
    8288        // Control user's status
    8389        add_action('set_current_user', function() {
     
    108114    protected function initialize_hooks()
    109115    {
    110         // Hook into AAM config initialization and enrich it with ConfigPress
    111         // settings
    112         add_filter('aam_init_config_filter', function($configs) {
    113             return $this->_aam_initialize_config($configs);
    114         });
    115 
    116116        // Ensuring safely of transactions
    117117        add_filter('gettext_advanced-access-manager', function($translation) {
  • advanced-access-manager/trunk/readme.txt

    r3304543 r3308206  
    44Requires at least: 5.8.0
    55Requires PHP: 5.6.0
    6 Tested up to: 6.8.0
    7 Stable tag: 7.0.4
     6Tested up to: 6.8.1
     7Stable tag: 7.0.5
    88
    99Your WordPress security starts within — with AAM. Take control of your WordPress website and solve security gaps today.
     
    6060
    6161== Changelog ==
     62
     63= 7.0.5 =
     64* Fixed: ConfigPress are not taken into consideration before init hook [https://github.com/aamplugin/advanced-access-manager/issues/468](https://github.com/aamplugin/advanced-access-manager/issues/468)
     65* Fixed: AAM does not display default terms pin anymore [https://github.com/aamplugin/advanced-access-manager/issues/467] (https://github.com/aamplugin/advanced-access-manager/issues/467)
     66* Fixed: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /../Framework/Service/Policies.php:661 [https://github.com/aamplugin/advanced-access-manager/issues/466](https://github.com/aamplugin/advanced-access-manager/issues/466)
    6267
    6368= 7.0.4 =
Note: See TracChangeset for help on using the changeset viewer.