Changeset 2814539
- Timestamp:
- 11/08/2022 04:26:35 PM (3 years ago)
- Location:
- audienceplayer
- Files:
-
- 16 edited
- 1 copied
-
tags/3.3.8 (copied) (copied from audienceplayer/trunk)
-
tags/3.3.8/audienceplayer.php (modified) (1 diff)
-
tags/3.3.8/languages/audienceplayer-wordpress-plugin.pot (modified) (1 diff)
-
tags/3.3.8/readme.txt (modified) (1 diff)
-
tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php (modified) (1 diff)
-
tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php (modified) (1 diff)
-
tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php (modified) (2 diffs)
-
tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php (modified) (4 diffs)
-
tags/3.3.8/static/html/admin_help_release_notes.html (modified) (1 diff)
-
trunk/audienceplayer.php (modified) (1 diff)
-
trunk/languages/audienceplayer-wordpress-plugin.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php (modified) (1 diff)
-
trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php (modified) (1 diff)
-
trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php (modified) (2 diffs)
-
trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php (modified) (4 diffs)
-
trunk/static/html/admin_help_release_notes.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
audienceplayer/tags/3.3.8/audienceplayer.php
r2812134 r2814539 9 9 Description: AudiencePlayer integration 10 10 Author: AudiencePlayer 11 Version: 3.3. 711 Version: 3.3.8 12 12 Author URI: https://www.audienceplayer.com 13 13 Text Domain: audienceplayer -
audienceplayer/tags/3.3.8/languages/audienceplayer-wordpress-plugin.pot
r2812134 r2814539 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: 3.3. 7\n"5 "Project-Id-Version: 3.3.8\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/audienceplayer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
audienceplayer/tags/3.3.8/readme.txt
r2812134 r2814539 1 1 === AudiencePlayer === 2 2 Contributors: audienceplayer 3 Stable tag: 3.3. 73 Stable tag: 3.3.8 4 4 Tested up to: 6.0 5 5 Requires at least: 5.5 -
audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php
r2812134 r2814539 39 39 40 40 // 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', 42 42 43 43 // DB migration version number is maintained here -
audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php
r2811409 r2814539 127 127 ) { 128 128 $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); 129 132 } 130 exit;131 133 } 132 134 -
audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php
r2544940 r2814539 40 40 public function writeLog(int $logLevel, $logName, $description, $properties, $projectId = 0) 41 41 { 42 global $wpdb ;42 global $wpdb, $wp_version; 43 43 44 44 $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 } 45 53 46 54 try { … … 51 59 'log_name' => $logName, 52 60 'description' => $description, 53 'properties' => json_encode($properties),61 'properties' => $properties, 54 62 'wordpress_user_id' => $properties['wordpress_user_id'] ?? null, 55 63 'audienceplayer_user_id' => $properties['audienceplayer_user_id'] ?? null, -
audienceplayer/tags/3.3.8/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php
r2812134 r2814539 595 595 // metadata already handled in syncAudiencePlayerUserAuthentication, but password may also have been changed 596 596 if ($ret) { 597 597 598 if ($args) { 598 ($this->isChangeAttemptedOnPassword = true) && 599 599 600 $this->isChangeAttemptedOnPassword = true; 600 601 $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 } 608 611 } 612 609 613 } else { 614 610 615 $this->writeLog( 611 616 Constants::LOG_LEVEL_SYSTEM_ERROR, … … 873 878 $ret = false; 874 879 875 if ($ roles) {880 if ($wordpressUserId && $roles) { 876 881 877 882 $intersection = []; … … 902 907 protected function isWordpressSubscriberUser(int $wordpressUserId = 0) 903 908 { 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; 905 913 } 906 914 … … 911 919 protected function isWordpressAdminUser(int $wordpressUserId = 0) 912 920 { 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 ); 914 926 } 915 927 -
audienceplayer/tags/3.3.8/static/html/admin_help_release_notes.html
r2812134 r2814539 1 1 <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> 2 11 3 12 <div class="audienceplayer-release-note"> -
audienceplayer/trunk/audienceplayer.php
r2812134 r2814539 9 9 Description: AudiencePlayer integration 10 10 Author: AudiencePlayer 11 Version: 3.3. 711 Version: 3.3.8 12 12 Author URI: https://www.audienceplayer.com 13 13 Text Domain: audienceplayer -
audienceplayer/trunk/languages/audienceplayer-wordpress-plugin.pot
r2812134 r2814539 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: 3.3. 7\n"5 "Project-Id-Version: 3.3.8\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/audienceplayer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
audienceplayer/trunk/readme.txt
r2812134 r2814539 1 1 === AudiencePlayer === 2 2 Contributors: audienceplayer 3 Stable tag: 3.3. 73 Stable tag: 3.3.8 4 4 Tested up to: 6.0 5 5 Requires at least: 5.5 -
audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Config/Constants.php
r2812134 r2814539 39 39 40 40 // 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', 42 42 43 43 // DB migration version number is maintained here -
audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/AjaxTrait.php
r2811409 r2814539 127 127 ) { 128 128 $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); 129 132 } 130 exit;131 133 } 132 134 -
audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/LogTrait.php
r2544940 r2814539 40 40 public function writeLog(int $logLevel, $logName, $description, $properties, $projectId = 0) 41 41 { 42 global $wpdb ;42 global $wpdb, $wp_version; 43 43 44 44 $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 } 45 53 46 54 try { … … 51 59 'log_name' => $logName, 52 60 'description' => $description, 53 'properties' => json_encode($properties),61 'properties' => $properties, 54 62 'wordpress_user_id' => $properties['wordpress_user_id'] ?? null, 55 63 'audienceplayer_user_id' => $properties['audienceplayer_user_id'] ?? null, -
audienceplayer/trunk/src/AudiencePlayer/AudiencePlayerWordpressPlugin/Resources/UserSyncTrait.php
r2812134 r2814539 595 595 // metadata already handled in syncAudiencePlayerUserAuthentication, but password may also have been changed 596 596 if ($ret) { 597 597 598 if ($args) { 598 ($this->isChangeAttemptedOnPassword = true) && 599 599 600 $this->isChangeAttemptedOnPassword = true; 600 601 $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 } 608 611 } 612 609 613 } else { 614 610 615 $this->writeLog( 611 616 Constants::LOG_LEVEL_SYSTEM_ERROR, … … 873 878 $ret = false; 874 879 875 if ($ roles) {880 if ($wordpressUserId && $roles) { 876 881 877 882 $intersection = []; … … 902 907 protected function isWordpressSubscriberUser(int $wordpressUserId = 0) 903 908 { 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; 905 913 } 906 914 … … 911 919 protected function isWordpressAdminUser(int $wordpressUserId = 0) 912 920 { 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 ); 914 926 } 915 927 -
audienceplayer/trunk/static/html/admin_help_release_notes.html
r2812134 r2814539 1 1 <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> 2 11 3 12 <div class="audienceplayer-release-note">
Note: See TracChangeset
for help on using the changeset viewer.