Plugin Directory

Changeset 2814539


Ignore:
Timestamp:
11/08/2022 04:26:35 PM (3 years ago)
Author:
audienceplayer
Message:
  • released version 3.3.8
Location:
audienceplayer
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • audienceplayer/tags/3.3.8/audienceplayer.php

    r2812134 r2814539  
    99Description: AudiencePlayer integration
    1010Author: AudiencePlayer
    11 Version: 3.3.7
     11Version: 3.3.8
    1212Author URI: https://www.audienceplayer.com
    1313Text Domain: audienceplayer
  • audienceplayer/tags/3.3.8/languages/audienceplayer-wordpress-plugin.pot

    r2812134 r2814539  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: 3.3.7\n"
     5"Project-Id-Version: 3.3.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/audienceplayer\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • audienceplayer/tags/3.3.8/readme.txt

    r2812134 r2814539  
    11=== AudiencePlayer ===
    22Contributors: audienceplayer
    3 Stable tag: 3.3.7
     3Stable tag: 3.3.8
    44Tested up to: 6.0
    55Requires at least: 5.5
  • audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php

    r2812134 r2814539  
    3939
    4040        // Main plugin version number here and in main plugin file header are automatically overwritten in gulp-build script
    41         PLUGIN_VERSION = '3.3.7',
     41        PLUGIN_VERSION = '3.3.8',
    4242
    4343        // DB migration version number is maintained here
  • audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php

    r2811409 r2814539  
    127127        ) {
    128128            $this->exportLogs();
     129            exit;
     130        } else {
     131            \wp_send_json_error(['message' => Constants::STATUS_NOT_AUTHORISED_MSG, 'code' => Constants::STATUS_NOT_AUTHORISED_CODE], Constants::STATUS_NOT_AUTHORISED_CODE);
    129132        }
    130         exit;
    131133    }
    132134
  • audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php

    r2544940 r2814539  
    4040    public function writeLog(int $logLevel, $logName, $description, $properties, $projectId = 0)
    4141    {
    42         global $wpdb;
     42        global $wpdb, $wp_version;
    4343
    4444        $ret = null;
     45
     46        try {
     47            $properties = json_encode(array_merge([
     48                'wordpress_version' => $wp_version,
     49                'plugin_version' => self::fetchPluginVersion(),
     50            ], $properties));
     51        } catch (\Exception $e) {
     52        }
    4553
    4654        try {
     
    5159                    'log_name' => $logName,
    5260                    'description' => $description,
    53                     'properties' => json_encode($properties),
     61                    'properties' => $properties,
    5462                    'wordpress_user_id' => $properties['wordpress_user_id'] ?? null,
    5563                    'audienceplayer_user_id' => $properties['audienceplayer_user_id'] ?? null,
  • audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php

    r2812134 r2814539  
    595595                // metadata already handled in syncAudiencePlayerUserAuthentication, but password may also have been changed
    596596                if ($ret) {
     597
    597598                    if ($args) {
    598                         ($this->isChangeAttemptedOnPassword = true) &&
    599 
     599
     600                        $this->isChangeAttemptedOnPassword = true;
    600601                        $ret = $this->updateWordpressUser($user->ID, $args);
    601                     } else {
    602                         $this->writeLog(
    603                             Constants::LOG_LEVEL_SYSTEM_ERROR,
    604                             'resource.user-sync.sync-audienceplayer-user-to-wordpress.update-wordpress-user',
    605                             'Error updating wordpress user after successful audienceplayer user authentication synchronisation',
    606                             $logArgs
    607                         );
     602
     603                        if (!$ret) {
     604                            $this->writeLog(
     605                                Constants::LOG_LEVEL_SYSTEM_ERROR,
     606                                'resource.user-sync.sync-audienceplayer-user-to-wordpress.update-wordpress-user',
     607                                'Error updating wordpress user after successful audienceplayer user authentication synchronisation',
     608                                $logArgs
     609                            );
     610                        }
    608611                    }
     612
    609613                } else {
     614
    610615                    $this->writeLog(
    611616                        Constants::LOG_LEVEL_SYSTEM_ERROR,
     
    873878        $ret = false;
    874879
    875         if ($roles) {
     880        if ($wordpressUserId && $roles) {
    876881
    877882            $intersection = [];
     
    902907    protected function isWordpressSubscriberUser(int $wordpressUserId = 0)
    903908    {
    904         return $this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) && count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) === 1;
     909        return
     910            $wordpressUserId &&
     911            $this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) &&
     912            count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) === 1;
    905913    }
    906914
     
    911919    protected function isWordpressAdminUser(int $wordpressUserId = 0)
    912920    {
    913         return !$this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) || count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) > 1;
     921        return
     922            $wordpressUserId && (
     923                !$this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) ||
     924                count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) > 1
     925            );
    914926    }
    915927
  • audienceplayer/tags/3.3.8/static/html/admin_help_release_notes.html

    r2812134 r2814539  
    11<h3>Release notes</h3>
     2
     3<div class="audienceplayer-release-note">
     4    <h5>v3.3.8</h5>
     5    <p class="date">2022-11-08</p>
     6    <p class="content">
     7        Bug fixes.<br/>
     8        Improved admin logs.
     9    </p>
     10</div>
    211
    312<div class="audienceplayer-release-note">
  • audienceplayer/trunk/audienceplayer.php

    r2812134 r2814539  
    99Description: AudiencePlayer integration
    1010Author: AudiencePlayer
    11 Version: 3.3.7
     11Version: 3.3.8
    1212Author URI: https://www.audienceplayer.com
    1313Text Domain: audienceplayer
  • audienceplayer/trunk/languages/audienceplayer-wordpress-plugin.pot

    r2812134 r2814539  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: 3.3.7\n"
     5"Project-Id-Version: 3.3.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/audienceplayer\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • audienceplayer/trunk/readme.txt

    r2812134 r2814539  
    11=== AudiencePlayer ===
    22Contributors: audienceplayer
    3 Stable tag: 3.3.7
     3Stable tag: 3.3.8
    44Tested up to: 6.0
    55Requires at least: 5.5
  • audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php

    r2812134 r2814539  
    3939
    4040        // Main plugin version number here and in main plugin file header are automatically overwritten in gulp-build script
    41         PLUGIN_VERSION = '3.3.7',
     41        PLUGIN_VERSION = '3.3.8',
    4242
    4343        // DB migration version number is maintained here
  • audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php

    r2811409 r2814539  
    127127        ) {
    128128            $this->exportLogs();
     129            exit;
     130        } else {
     131            \wp_send_json_error(['message' => Constants::STATUS_NOT_AUTHORISED_MSG, 'code' => Constants::STATUS_NOT_AUTHORISED_CODE], Constants::STATUS_NOT_AUTHORISED_CODE);
    129132        }
    130         exit;
    131133    }
    132134
  • audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php

    r2544940 r2814539  
    4040    public function writeLog(int $logLevel, $logName, $description, $properties, $projectId = 0)
    4141    {
    42         global $wpdb;
     42        global $wpdb, $wp_version;
    4343
    4444        $ret = null;
     45
     46        try {
     47            $properties = json_encode(array_merge([
     48                'wordpress_version' => $wp_version,
     49                'plugin_version' => self::fetchPluginVersion(),
     50            ], $properties));
     51        } catch (\Exception $e) {
     52        }
    4553
    4654        try {
     
    5159                    'log_name' => $logName,
    5260                    'description' => $description,
    53                     'properties' => json_encode($properties),
     61                    'properties' => $properties,
    5462                    'wordpress_user_id' => $properties['wordpress_user_id'] ?? null,
    5563                    'audienceplayer_user_id' => $properties['audienceplayer_user_id'] ?? null,
  • audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php

    r2812134 r2814539  
    595595                // metadata already handled in syncAudiencePlayerUserAuthentication, but password may also have been changed
    596596                if ($ret) {
     597
    597598                    if ($args) {
    598                         ($this->isChangeAttemptedOnPassword = true) &&
    599 
     599
     600                        $this->isChangeAttemptedOnPassword = true;
    600601                        $ret = $this->updateWordpressUser($user->ID, $args);
    601                     } else {
    602                         $this->writeLog(
    603                             Constants::LOG_LEVEL_SYSTEM_ERROR,
    604                             'resource.user-sync.sync-audienceplayer-user-to-wordpress.update-wordpress-user',
    605                             'Error updating wordpress user after successful audienceplayer user authentication synchronisation',
    606                             $logArgs
    607                         );
     602
     603                        if (!$ret) {
     604                            $this->writeLog(
     605                                Constants::LOG_LEVEL_SYSTEM_ERROR,
     606                                'resource.user-sync.sync-audienceplayer-user-to-wordpress.update-wordpress-user',
     607                                'Error updating wordpress user after successful audienceplayer user authentication synchronisation',
     608                                $logArgs
     609                            );
     610                        }
    608611                    }
     612
    609613                } else {
     614
    610615                    $this->writeLog(
    611616                        Constants::LOG_LEVEL_SYSTEM_ERROR,
     
    873878        $ret = false;
    874879
    875         if ($roles) {
     880        if ($wordpressUserId && $roles) {
    876881
    877882            $intersection = [];
     
    902907    protected function isWordpressSubscriberUser(int $wordpressUserId = 0)
    903908    {
    904         return $this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) && count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) === 1;
     909        return
     910            $wordpressUserId &&
     911            $this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) &&
     912            count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) === 1;
    905913    }
    906914
     
    911919    protected function isWordpressAdminUser(int $wordpressUserId = 0)
    912920    {
    913         return !$this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) || count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) > 1;
     921        return
     922            $wordpressUserId && (
     923                !$this->hasWordpressUserRoles($wordpressUserId, ['subscriber']) ||
     924                count($this->fetchWordpressUserProperty($wordpressUserId, 'roles')) > 1
     925            );
    914926    }
    915927
  • audienceplayer/trunk/static/html/admin_help_release_notes.html

    r2812134 r2814539  
    11<h3>Release notes</h3>
     2
     3<div class="audienceplayer-release-note">
     4    <h5>v3.3.8</h5>
     5    <p class="date">2022-11-08</p>
     6    <p class="content">
     7        Bug fixes.<br/>
     8        Improved admin logs.
     9    </p>
     10</div>
    211
    312<div class="audienceplayer-release-note">
Note: See TracChangeset for help on using the changeset viewer.