Changeset 3302243
- Timestamp:
- 05/28/2025 01:23:59 PM (9 months ago)
- Location:
- brizy
- Files:
-
- 12 edited
- 1 copied
-
tags/2.6.21 (copied) (copied from brizy/trunk)
-
tags/2.6.21/README.md (modified) (2 diffs)
-
tags/2.6.21/brizy.php (modified) (2 diffs)
-
tags/2.6.21/editor/api.php (modified) (38 diffs)
-
tags/2.6.21/languages/brizy.pot (modified) (2 diffs)
-
tags/2.6.21/readme.txt (modified) (2 diffs)
-
tags/2.6.21/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/README.md (modified) (2 diffs)
-
trunk/brizy.php (modified) (2 diffs)
-
trunk/editor/api.php (modified) (38 diffs)
-
trunk/languages/brizy.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
brizy/tags/2.6.21/README.md
r3302199 r3302243 5 5 Tested up to: 6.8.1<br> 6 6 Requires PHP: 7.2.24<br> 7 Stable tag: 2.6.2 0<br>7 Stable tag: 2.6.21<br> 8 8 License: GPLv3<br> 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 136 136 137 137 ## Changelog 138 139 ### 2.6.21 - 2025-05-28 140 * Fixed: Check if the current user can "list_users" on Posts component 138 141 139 142 ### 2.6.20 - 2025-05-28 -
brizy/tags/2.6.21/brizy.php
r3302199 r3302243 6 6 * Author: Brizy.io 7 7 * Author URI: https://brizy.io/ 8 * Version: 2.6.2 08 * Version: 2.6.21 9 9 * Text Domain: brizy 10 10 * License: GPLv3 … … 19 19 define( 'BRIZY_DEVELOPMENT', false ); 20 20 define( 'BRIZY_LOG', false ); 21 define( 'BRIZY_VERSION', '2.6.2 0' );21 define( 'BRIZY_VERSION', '2.6.21' ); 22 22 define( 'BRIZY_MINIMUM_PRO_VERSION', '2.4.15' ); 23 23 define( 'BRIZY_MINIMUM_COMPILER_VERSION', '315-wp' ); 24 24 define( 'BRIZY_RECOMPILE_TAG', 1748249026 ); 25 define( 'BRIZY_EDITOR_VERSION', BRIZY_DEVELOPMENT ? 'dev' : '315-wp' );25 define( 'BRIZY_EDITOR_VERSION', BRIZY_DEVELOPMENT ? 'dev' : '315-wp' ); 26 26 define( 'BRIZY_SYNC_VERSION', '315' ); 27 27 define( 'BRIZY_FILE', __FILE__ ); -
brizy/tags/2.6.21/editor/api.php
r3302199 r3302243 1 1 <?php 2 2 3 class Brizy_Editor_API extends Brizy_Admin_AbstractApi { 4 5 const nonce = 'brizy-api'; 6 const AJAX_GET_POST_INFO = '_get_post_info'; 7 const AJAX_GET = '_editor_get_items'; 8 const AJAX_UPDATE = '_update_item'; 9 const AJAX_GET_PROJECT = '_get_project'; 10 const AJAX_SET_PROJECT = '_set_project'; 11 const AJAX_LOCK_PROJECT = '_lock_project'; 12 const AJAX_MEDIA = '_media'; 13 const AJAX_SIDEBARS = '_sidebars'; 14 const AJAX_SIDEBAR_CONTENT = '_sidebar_content'; 15 const AJAX_SHORTCODE_CONTENT = '_shortcode_content'; 16 const AJAX_PLACEHOLDER_CONTENT = '_placeholder_content'; 17 const AJAX_PLACEHOLDERS_CONTENT = '_placeholders_content'; 18 const AJAX_GET_POST_OBJECTS = '_get_posts'; 19 const AJAX_SEARCH_POST = '_search_posts'; 20 const AJAX_GET_MENU_LIST = '_get_menu_list'; 21 const AJAX_REMOVE_LOCK = '_remove_lock'; 22 const AJAX_HEARTBEAT = '_heartbeat'; 23 const AJAX_TAKE_OVER = '_take_over'; 24 const AJAX_JWT_TOKEN = '_multipass_create'; 25 const AJAX_UPDATE_MENU_DATA = '_update_menu_data'; 26 const AJAX_UPDATE_EDITOR_META_DATA = '_update_editor_meta_data'; 27 const AJAX_UPDATE_MENU_ITEM_DATA = '_update_menu_item_data'; 28 const AJAX_MEDIA_METAKEY = '_get_media_key'; 29 const AJAX_CREATE_ATTACHMENT_UID = '_create_attachment_uid'; 30 const AJAX_SET_FEATURED_IMAGE = '_set_featured_image'; 31 const AJAX_SET_IMAGE_FOCAL_PT = '_set_featured_image_focal_point'; 32 const AJAX_REMOVE_FEATURED_IMAGE = '_remove_featured_image'; 33 const AJAX_TIMESTAMP = '_timestamp'; 34 const AJAX_SET_TEMPLATE_TYPE = '_set_template_type'; 35 const AJAX_GET_USERS = '_get_users'; 36 const AJAX_GET_TERMS = '_get_terms'; 37 const AJAX_GET_TERMS_BY = '_get_terms_by'; 38 const AJAX_GET_POST_TAXONOMIES = '_get_post_taxonomies'; 3 class Brizy_Editor_API extends Brizy_Admin_AbstractApi 4 { 5 6 const nonce = 'brizy-api'; 7 const AJAX_GET_POST_INFO = '_get_post_info'; 8 const AJAX_GET = '_editor_get_items'; 9 const AJAX_UPDATE = '_update_item'; 10 const AJAX_GET_PROJECT = '_get_project'; 11 const AJAX_SET_PROJECT = '_set_project'; 12 const AJAX_LOCK_PROJECT = '_lock_project'; 13 const AJAX_MEDIA = '_media'; 14 const AJAX_SIDEBARS = '_sidebars'; 15 const AJAX_SIDEBAR_CONTENT = '_sidebar_content'; 16 const AJAX_SHORTCODE_CONTENT = '_shortcode_content'; 17 const AJAX_PLACEHOLDER_CONTENT = '_placeholder_content'; 18 const AJAX_PLACEHOLDERS_CONTENT = '_placeholders_content'; 19 const AJAX_GET_POST_OBJECTS = '_get_posts'; 20 const AJAX_SEARCH_POST = '_search_posts'; 21 const AJAX_GET_MENU_LIST = '_get_menu_list'; 22 const AJAX_REMOVE_LOCK = '_remove_lock'; 23 const AJAX_HEARTBEAT = '_heartbeat'; 24 const AJAX_TAKE_OVER = '_take_over'; 25 const AJAX_JWT_TOKEN = '_multipass_create'; 26 const AJAX_UPDATE_MENU_DATA = '_update_menu_data'; 27 const AJAX_UPDATE_EDITOR_META_DATA = '_update_editor_meta_data'; 28 const AJAX_UPDATE_MENU_ITEM_DATA = '_update_menu_item_data'; 29 const AJAX_MEDIA_METAKEY = '_get_media_key'; 30 const AJAX_CREATE_ATTACHMENT_UID = '_create_attachment_uid'; 31 const AJAX_SET_FEATURED_IMAGE = '_set_featured_image'; 32 const AJAX_SET_IMAGE_FOCAL_PT = '_set_featured_image_focal_point'; 33 const AJAX_REMOVE_FEATURED_IMAGE = '_remove_featured_image'; 34 const AJAX_TIMESTAMP = '_timestamp'; 35 const AJAX_SET_TEMPLATE_TYPE = '_set_template_type'; 36 const AJAX_GET_USERS = '_get_users'; 37 const AJAX_GET_TERMS = '_get_terms'; 38 const AJAX_GET_TERMS_BY = '_get_terms_by'; 39 const AJAX_GET_POST_TAXONOMIES = '_get_post_taxonomies'; 39 40 const AJAX_GET_ADOBE_FONTS = '_get_adobe_fonts'; 40 41 41 const AJAX_GET_DYNAMIC_CONTENT = '_get_dynamic_content'; 42 43 /** 44 * @var Brizy_Editor_Post 45 */ 46 private $post; 47 48 /** 49 * @return Brizy_Editor_Post 50 */ 51 public function get_post() { 52 return $this->post; 53 } 54 55 /** 56 * Brizy_Editor_API constructor. 57 * 58 * @param Brizy_Editor_Project $project 59 * @param Brizy_Editor_Post $post 60 */ 61 public function __construct( $post ) { 42 const AJAX_GET_DYNAMIC_CONTENT = '_get_dynamic_content'; 43 44 /** 45 * @var Brizy_Editor_Post 46 */ 47 private $post; 48 49 /** 50 * @return Brizy_Editor_Post 51 */ 52 public function get_post() 53 { 54 return $this->post; 55 } 56 57 /** 58 * Brizy_Editor_API constructor. 59 * 60 * @param Brizy_Editor_Project $project 61 * @param Brizy_Editor_Post $post 62 */ 63 public function __construct($post) 64 { 62 65 63 66 $this->post = $post; … … 66 69 } 67 70 68 protected function initializeApiActions() { 69 if ( ! Brizy_Editor_User::is_user_allowed() ) {71 protected function initializeApiActions() 72 {if ( ! Brizy_Editor_User::is_user_allowed() ) { 70 73 return; 71 74 } … … 103 106 add_action($p . 'nopriv_' . Brizy_Editor::prefix(self::AJAX_TIMESTAMP), array($this, 'timestamp')); 104 107 105 } 106 107 protected function getRequestNonce() { 108 return $this->param( 'hash' ); 109 } 110 111 public function addPostTaxonomies() { 108 } 109 110 protected function getRequestNonce() 111 { 112 return $this->param('hash'); 113 } 114 115 public function addPostTaxonomies() 116 { 112 117 113 118 $this->verifyNonce( self::nonce ); … … 131 136 } 132 137 133 public function addDynamicContent() { 134 $this->verifyNonce( self::nonce );138 public function addDynamicContent() 139 {$this->verifyNonce( self::nonce ); 135 140 136 141 $context = Brizy_Content_ContextFactory::createContext( Brizy_Editor_Project::get(), $this->get_post() ); … … 138 143 $placeholders = $provider->getGroupedPlaceholdersForApiResponse(); 139 144 140 return $this->success( $placeholders);141 }142 143 public function lock_project() { 144 $this->verifyNonce( self::nonce );145 return $this->success($placeholders); 146 } 147 148 public function lock_project() 149 {$this->verifyNonce( self::nonce ); 145 150 146 151 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { … … 148 153 } 149 154 155 $editor = new Brizy_Editor_Editor_Editor(Brizy_Editor_Project::get(), null); 156 $this->success($editor->getProjectStatus()); 157 } 158 159 public function removeProjectLock() 160 {$this->verifyNonce( self::nonce ); 161 162 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 163 Brizy_Editor::get()->removeProjectLock(); 164 } 165 166 $editor = new Brizy_Editor_Editor_Editor(Brizy_Editor_Project::get(), null); 167 $this->success($editor->getProjectStatus()); 168 } 169 170 public function heartbeat() 171 {$this->verifyNonce( self::nonce ); 172 173 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 174 Brizy_Editor::get()->lockProject(); 175 } 150 176 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 151 177 $this->success( $editor->getProjectStatus() ); 152 178 } 153 179 154 public function removeProjectLock() { 155 $this->verifyNonce( self::nonce ); 156 157 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 158 Brizy_Editor::get()->removeProjectLock(); 159 } 180 public function takeOver() 181 {$this->verifyNonce( self::nonce ); 182 183 Brizy_Editor::get()->lockProject(); 160 184 161 185 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); … … 163 187 } 164 188 165 public function heartbeat() { 166 $this->verifyNonce( self::nonce ); 167 168 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 169 Brizy_Editor::get()->lockProject(); 170 } 171 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 172 $this->success( $editor->getProjectStatus() ); 173 } 174 175 public function takeOver() { 176 $this->verifyNonce( self::nonce ); 177 178 Brizy_Editor::get()->lockProject(); 179 180 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 181 $this->success( $editor->getProjectStatus() ); 182 } 183 184 public function timestamp() { 185 $this->success( array( 'timestamp' => time() ) ); 186 } 187 188 189 public function set_featured_image() { 190 $this->verifyNonce( self::nonce ); 189 public function timestamp() 190 { 191 $this->success(array('timestamp' => time())); 192 } 193 194 195 public function set_featured_image() 196 {$this->verifyNonce( self::nonce ); 191 197 192 198 if ( ! isset( $_REQUEST['attachmentId'] ) ) { … … 202 208 } 203 209 204 $this->error( 400, 'Invalid post');205 }206 207 public function set_featured_image_focal_point() { 208 $this->verifyNonce( self::nonce );210 $this->error(400, 'Invalid post'); 211 } 212 213 public function set_featured_image_focal_point() 214 {$this->verifyNonce( self::nonce ); 209 215 210 216 if ( ! isset( $_REQUEST['attachmentId'] ) || ! isset( $_REQUEST['pointX'] ) || ! isset( $_REQUEST['pointY'] ) ) { … … 212 218 } 213 219 214 if ( $this->post && $this->post->uses_editor()) {220 if ($this->post && $this->post->uses_editor()) { 215 221 216 222 update_post_meta( … … 221 227 'y' => $_REQUEST['pointY'], 222 228 ) 223 );229 ); 224 230 225 231 $this->success( array() ); 226 232 } 227 233 228 $this->error( 400, 'Invalid post');229 }230 231 public function remove_featured_image() { 232 $this->verifyNonce( self::nonce );234 $this->error(400, 'Invalid post'); 235 } 236 237 public function remove_featured_image() 238 {$this->verifyNonce( self::nonce ); 233 239 234 240 if ( $this->post && $this->post->uses_editor() ) { … … 238 244 } 239 245 240 $this->error( 400, 'Invalid post');241 }246 $this->error(400, 'Invalid post'); 247 } 242 248 243 249 … … 297 303 * @internal 298 304 **/ 299 public function get_project() { 300 try { 301 $this->verifyNonce( self::nonce ); 302 $data = Brizy_Editor_Project::get()->createResponse(); 303 $this->success( $data ); 304 } catch ( Exception $exception ) { 305 Brizy_Logger::instance()->exception( $exception ); 306 $this->error( $exception->getCode(), $exception->getMessage() ); 307 } 308 } 309 310 /** 311 * @internal 312 */ 313 public function set_project() { 314 try { 305 public function get_project() 306 { 307 try { 308 $this->verifyNonce(self::nonce); 309 $data = Brizy_Editor_Project::get()->createResponse(); 310 $this->success($data); 311 } catch (Exception $exception) { 312 Brizy_Logger::instance()->exception($exception); 313 $this->error($exception->getCode(), $exception->getMessage()); 314 } 315 } 316 317 /** 318 * @internal 319 */ 320 public function set_project() 321 {try { 315 322 $this->verifyNonce( self::nonce ); 316 323 … … 350 357 } 351 358 352 $this->success( $project->createResponse());353 } catch ( Exception $exception) {354 Brizy_Logger::instance()->exception( $exception);355 $this->error( 400, $exception->getMessage());356 exit;357 }358 }359 360 /**361 * @internal362 **/363 public function get_item() { 364 try {359 $this->success($project->createResponse()); 360 } catch (Exception $exception) { 361 Brizy_Logger::instance()->exception($exception); 362 $this->error(400, $exception->getMessage()); 363 exit; 364 } 365 } 366 367 /** 368 * @internal 369 **/ 370 public function get_item() 371 {try { 365 372 $this->verifyNonce( self::nonce ); 366 373 … … 380 387 } 381 388 382 /**383 * @internal384 **/385 public function get_post_info() { 386 try {389 /** 390 * @internal 391 **/ 392 public function get_post_info() 393 {try { 387 394 $this->verifyNonce( self::nonce ); 388 395 … … 415 422 } 416 423 417 /**418 * @internal419 **/420 public function update_item() { 421 try {424 /** 425 * @internal 426 **/ 427 public function update_item() 428 {try { 422 429 $this->verifyNonce( self::nonce ); 423 430 … … 442 449 } 443 450 444 if ( $compiled) {445 $this->post->set_encoded_compiled_html( $compiled['html'] );451 if ($compiled) { 452 $this->post->set_encoded_compiled_html( $compiled['html'] ); 446 453 $this->post->set_compiled_scripts( [ 447 454 'free' => $compiled['assets']['freeScripts'], 448 'pro' => ( isset( $compiled['assets']['proScripts'] ) ? $compiled['assets']['proScripts'] : [] ),449 ] );450 $this->post->set_compiled_styles( [455 'pro' => ( isset($compiled['assets']['proScripts'] ) ? $compiled['assets']['proScripts'] : [] ), 456 ]); 457 $this->post->set_compiled_styles( [ 451 458 'free' => $compiled['assets']['freeStyles'], 452 459 'pro' => ( isset( $compiled['assets']['proStyles'] ) ? $compiled['assets']['proStyles'] : [] ), … … 467 474 } 468 475 469 if ( $data) {470 $this->post->set_editor_data( $data );476 if ($data) { 477 $this->post->set_editor_data( $data ); 471 478 $this->post->set_editor_version( BRIZY_EDITOR_VERSION ); 472 479 } … … 486 493 } 487 494 488 $this->success( $this->post->createResponse() ); 489 } catch ( Exception $exception ) { 490 Brizy_Logger::instance()->exception( $exception ); 491 $this->error( 500, $exception->getMessage() ); 492 } 493 } 494 495 /* 496 * Used for elements like Woocommerce pages. 497 */ 498 public function shortcode_content() { 499 try { 495 $this->success($this->post->createResponse()); 496 } catch (Exception $exception) { 497 Brizy_Logger::instance()->exception($exception); 498 $this->error(500, $exception->getMessage()); 499 } 500 } 501 502 /* 503 * Used for elements like Woocommerce pages. 504 */ 505 public function shortcode_content() 506 { 507 try { 500 508 501 509 $this->verifyNonce( self::nonce ); … … 515 523 ); 516 524 517 } catch ( Exception $exception) {518 Brizy_Logger::instance()->exception( $exception);519 $this->error( $exception->getCode(), $exception->getMessage());520 }521 }522 523 public function placeholder_content() { 524 try {525 } catch (Exception $exception) { 526 Brizy_Logger::instance()->exception($exception); 527 $this->error($exception->getCode(), $exception->getMessage()); 528 } 529 } 530 531 public function placeholder_content() 532 {try { 525 533 $this->verifyNonce( self::nonce ); 526 534 $postId = $this->param( 'post_id' ); … … 557 565 ) 558 566 ); 559 } catch ( Exception $exception) {560 Brizy_Logger::instance()->exception( $exception);561 $this->error( $exception->getCode(), $exception->getMessage());562 }563 }564 565 public function placeholders_content() { 566 global $post, $wp_query;567 } catch (Exception $exception) { 568 Brizy_Logger::instance()->exception($exception); 569 $this->error($exception->getCode(), $exception->getMessage()); 570 } 571 } 572 573 public function placeholders_content() 574 {global $post, $wp_query; 567 575 try { 568 576 $this->verifyNonce( self::nonce ); … … 594 602 } 595 603 596 private function getPostSample( $templateId ) { 597 global $wp_query;604 private function getPostSample($templateId) 605 {global $wp_query; 598 606 $wp_post = get_post( $templateId ); 599 607 if ( $wp_post->post_type !== Brizy_Admin_Templates::CP_TEMPLATE ) { … … 692 700 ); 693 701 694 $wp_query->is_tax = true;695 }702 $wp_query->is_tax = true; 703 } 696 704 697 705 return array_pop( $terms ); … … 708 716 $posts = $wp_query->get_posts(); 709 717 710 return get_post( array_pop( $posts ));711 }712 $posts = $wp_query->get_posts();718 return get_post(array_pop($posts)); 719 } 720 $posts = $wp_query->get_posts(); 713 721 714 722 return get_post( array_pop( $posts ) );; … … 729 737 $wp_query->is_404 = true; 730 738 731 return null;732 case 'search':733 $wp_query->is_search = true;739 return null; 740 case 'search': 741 $wp_query->is_search = true; 734 742 735 743 return null; … … 769 777 $wp_query->is_day = true; 770 778 771 return null; 772 } 773 } 774 } 775 776 public function get_post_objects() { 779 return null; 780 } 781 } 782 } 783 784 public function get_post_objects() 785 { 777 786 778 787 global $wp_post_types; … … 801 810 } 802 811 803 public function get_sidebars() { 804 global $wp_registered_sidebars;812 public function get_sidebars() 813 {global $wp_registered_sidebars; 805 814 806 815 $this->verifyNonce( self::nonce ); … … 816 825 } 817 826 818 $this->success( $items ); 819 } 820 821 public function brizy_post_title_filter( $where, $wp_query = null ) { 827 $this->success($items); 828 } 829 830 public function brizy_post_title_filter($where, $wp_query = null) 831 { 822 832 823 833 global $wpdb; … … 831 841 } 832 842 833 return $where; 834 } 835 836 public function get_menu_list() { 837 $this->success( wp_get_nav_menus( array( 'hide_empty' => true ) ), 200 ); 838 } 839 840 /** 841 * Used in woocomerce producs, block conditions 842 */ 843 public function get_terms() { 843 return $where; 844 } 845 846 public function get_menu_list() 847 { 848 $this->success(wp_get_nav_menus(array('hide_empty' => true)), 200); 849 } 850 851 /** 852 * Used in woocomerce producs, block conditions 853 */ 854 public function get_terms() 855 { 844 856 845 857 try { … … 852 864 $this->success( array_values( $terms ) ); 853 865 854 } catch ( Exception $e ) { 855 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ] ); 856 $this->error( 500, $e->getMessage() ); 857 } 858 } 859 860 /** 861 * Used in posts filter element 862 */ 863 public function get_terms_by() { 866 } catch (Exception $e) { 867 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 868 $this->error(500, $e->getMessage()); 869 } 870 } 871 872 /** 873 * Used in posts filter element 874 */ 875 public function get_terms_by() 876 { 864 877 865 878 $this->verifyNonce( self::nonce ); … … 891 904 } 892 905 893 $this->success( $out);894 }895 896 /**897 * Used in posts filter element898 */899 public function search_post() { 900 $this->verifyNonce( self::nonce );906 $this->success($out); 907 } 908 909 /** 910 * Used in posts filter element 911 */ 912 public function search_post() 913 {$this->verifyNonce( self::nonce ); 901 914 $args = [ 'numberposts' => - 1 ]; 902 915 $args['post_type'] = array_values( get_post_types( [ 'public' => true ] ) ); … … 957 970 } 958 971 959 $this->success( $out);960 }961 962 public function get_users() { 963 $this->verifyNonce( self::nonce );972 $this->success($out); 973 } 974 975 public function get_users() 976 {$this->verifyNonce( self::nonce ); 964 977 965 978 $args = []; 966 979 $search = $this->param( 'search' ); 967 $include = $this->param( 'include' ); 980 $include = $this->param( 'include' );if (!user_can(get_current_user_id(), 'list_users')) { 981 $this->success([]); 982 } 968 983 969 984 $args['fields'] = [ 'ID', 'display_name' ]; … … 978 993 } 979 994 980 if ( is_array( $include ) && ! empty( $include )) {981 $args['include'] = $include;982 }995 if (is_array($include) && !empty($include)) { 996 $args['include'] = $include; 997 } 983 998 984 999 $users = array_map( … … 995 1010 } 996 1011 997 public function get_media_key() { 998 try {1012 public function get_media_key() 1013 {try { 999 1014 session_write_close(); 1000 1015 $this->verifyNonce( self::nonce ); … … 1009 1024 $this->success( array( 'uid' => $uid ) ); 1010 1025 1011 } catch ( Exception $e) {1012 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ]);1013 1014 return;1015 }1016 }1017 1018 /**1019 * @see Brizy_Admin_Migrations_AttachmentUidMigration1020 */1021 public function get_attachment_key() { 1022 try {1026 } catch (Exception $e) { 1027 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1028 1029 return; 1030 } 1031 } 1032 1033 /** 1034 * @see Brizy_Admin_Migrations_AttachmentUidMigration 1035 */ 1036 public function get_attachment_key() 1037 {try { 1023 1038 session_write_close(); 1024 1039 … … 1047 1062 } 1048 1063 1049 $this->success( array( 'uid' => $uid ) ); 1050 1051 } catch ( Exception $e ) { 1052 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ] ); 1053 1054 return; 1055 } 1056 } 1057 1058 public function setTemplateType() { 1059 try { 1064 $this->success(array('uid' => $uid)); 1065 1066 } catch (Exception $e) { 1067 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1068 1069 return; 1070 } 1071 } 1072 1073 public function setTemplateType() 1074 { 1075 try { 1060 1076 1061 1077 $this->verifyNonce( self::nonce ); … … 1082 1098 $this->success( [] ); 1083 1099 1084 } catch ( Exception $e) {1085 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ]);1086 $this->error( 500, $e->getMessage());1087 1088 return;1089 }1090 }1091 1092 1093 private function createMediaKey( $postId, $attachmentId ) { 1094 $uid = get_post_meta( $attachmentId, 'brizy_attachment_uid', true );1100 } catch (Exception $e) { 1101 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1102 $this->error(500, $e->getMessage()); 1103 1104 return; 1105 } 1106 } 1107 1108 1109 private function createMediaKey($postId, $attachmentId) 1110 {$uid = get_post_meta( $attachmentId, 'brizy_attachment_uid', true ); 1095 1111 1096 1112 if ( ! $uid ) { … … 1112 1128 } 1113 1129 1114 return $uid;1115 }1116 1117 public function getAdobeFonts() { 1118 $this->checkNonce( self::nonce );1130 return $uid; 1131 } 1132 1133 public function getAdobeFonts() 1134 {$this->checkNonce( self::nonce ); 1119 1135 1120 1136 $manager = new Brizy_Editor_Accounts_ServiceAccountManager( Brizy_Editor_Project::get() ); … … 1139 1155 } 1140 1156 1141 $this->success( json_decode( wp_remote_retrieve_body( $response ), true ));1142 }1157 $this->success(json_decode(wp_remote_retrieve_body($response), true)); 1158 } 1143 1159 } -
brizy/tags/2.6.21/languages/brizy.pot
r3302199 r3302243 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Brizy 2.6.2 0\n"5 "Project-Id-Version: Brizy 2.6.21\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/workspace\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05-28T1 2:05:49+00:00\n"12 "POT-Creation-Date: 2025-05-28T13:22:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" -
brizy/tags/2.6.21/readme.txt
r3302199 r3302243 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.2.24 7 Stable tag: 2.6.2 07 Stable tag: 2.6.21 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 133 133 134 134 == Changelog == 135 136 = 2.6.21 - 2025-05-28 = 137 * Fixed: Check if the current user can "list_users" on Posts component 135 138 136 139 = 2.6.20 - 2025-05-28 = -
brizy/tags/2.6.21/vendor/composer/installed.php
r3302199 r3302243 2 2 'root' => array( 3 3 'name' => 'brizy/brizy', 4 'pretty_version' => 'dev- master',5 'version' => 'dev- master',6 'reference' => ' a6dc4052345338bf7c11578495175283b4e6f9a2',4 'pretty_version' => 'dev-develop', 5 'version' => 'dev-develop', 6 'reference' => '1014ba9c47fb6ec6cb21bdddd30f0c95eeae09be', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 41 41 ), 42 42 'brizy/brizy' => array( 43 'pretty_version' => 'dev- master',44 'version' => 'dev- master',45 'reference' => ' a6dc4052345338bf7c11578495175283b4e6f9a2',43 'pretty_version' => 'dev-develop', 44 'version' => 'dev-develop', 45 'reference' => '1014ba9c47fb6ec6cb21bdddd30f0c95eeae09be', 46 46 'type' => 'library', 47 47 'install_path' => __DIR__ . '/../../', -
brizy/trunk/README.md
r3302199 r3302243 5 5 Tested up to: 6.8.1<br> 6 6 Requires PHP: 7.2.24<br> 7 Stable tag: 2.6.2 0<br>7 Stable tag: 2.6.21<br> 8 8 License: GPLv3<br> 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 136 136 137 137 ## Changelog 138 139 ### 2.6.21 - 2025-05-28 140 * Fixed: Check if the current user can "list_users" on Posts component 138 141 139 142 ### 2.6.20 - 2025-05-28 -
brizy/trunk/brizy.php
r3302199 r3302243 6 6 * Author: Brizy.io 7 7 * Author URI: https://brizy.io/ 8 * Version: 2.6.2 08 * Version: 2.6.21 9 9 * Text Domain: brizy 10 10 * License: GPLv3 … … 19 19 define( 'BRIZY_DEVELOPMENT', false ); 20 20 define( 'BRIZY_LOG', false ); 21 define( 'BRIZY_VERSION', '2.6.2 0' );21 define( 'BRIZY_VERSION', '2.6.21' ); 22 22 define( 'BRIZY_MINIMUM_PRO_VERSION', '2.4.15' ); 23 23 define( 'BRIZY_MINIMUM_COMPILER_VERSION', '315-wp' ); 24 24 define( 'BRIZY_RECOMPILE_TAG', 1748249026 ); 25 define( 'BRIZY_EDITOR_VERSION', BRIZY_DEVELOPMENT ? 'dev' : '315-wp' );25 define( 'BRIZY_EDITOR_VERSION', BRIZY_DEVELOPMENT ? 'dev' : '315-wp' ); 26 26 define( 'BRIZY_SYNC_VERSION', '315' ); 27 27 define( 'BRIZY_FILE', __FILE__ ); -
brizy/trunk/editor/api.php
r3302199 r3302243 1 1 <?php 2 2 3 class Brizy_Editor_API extends Brizy_Admin_AbstractApi { 4 5 const nonce = 'brizy-api'; 6 const AJAX_GET_POST_INFO = '_get_post_info'; 7 const AJAX_GET = '_editor_get_items'; 8 const AJAX_UPDATE = '_update_item'; 9 const AJAX_GET_PROJECT = '_get_project'; 10 const AJAX_SET_PROJECT = '_set_project'; 11 const AJAX_LOCK_PROJECT = '_lock_project'; 12 const AJAX_MEDIA = '_media'; 13 const AJAX_SIDEBARS = '_sidebars'; 14 const AJAX_SIDEBAR_CONTENT = '_sidebar_content'; 15 const AJAX_SHORTCODE_CONTENT = '_shortcode_content'; 16 const AJAX_PLACEHOLDER_CONTENT = '_placeholder_content'; 17 const AJAX_PLACEHOLDERS_CONTENT = '_placeholders_content'; 18 const AJAX_GET_POST_OBJECTS = '_get_posts'; 19 const AJAX_SEARCH_POST = '_search_posts'; 20 const AJAX_GET_MENU_LIST = '_get_menu_list'; 21 const AJAX_REMOVE_LOCK = '_remove_lock'; 22 const AJAX_HEARTBEAT = '_heartbeat'; 23 const AJAX_TAKE_OVER = '_take_over'; 24 const AJAX_JWT_TOKEN = '_multipass_create'; 25 const AJAX_UPDATE_MENU_DATA = '_update_menu_data'; 26 const AJAX_UPDATE_EDITOR_META_DATA = '_update_editor_meta_data'; 27 const AJAX_UPDATE_MENU_ITEM_DATA = '_update_menu_item_data'; 28 const AJAX_MEDIA_METAKEY = '_get_media_key'; 29 const AJAX_CREATE_ATTACHMENT_UID = '_create_attachment_uid'; 30 const AJAX_SET_FEATURED_IMAGE = '_set_featured_image'; 31 const AJAX_SET_IMAGE_FOCAL_PT = '_set_featured_image_focal_point'; 32 const AJAX_REMOVE_FEATURED_IMAGE = '_remove_featured_image'; 33 const AJAX_TIMESTAMP = '_timestamp'; 34 const AJAX_SET_TEMPLATE_TYPE = '_set_template_type'; 35 const AJAX_GET_USERS = '_get_users'; 36 const AJAX_GET_TERMS = '_get_terms'; 37 const AJAX_GET_TERMS_BY = '_get_terms_by'; 38 const AJAX_GET_POST_TAXONOMIES = '_get_post_taxonomies'; 3 class Brizy_Editor_API extends Brizy_Admin_AbstractApi 4 { 5 6 const nonce = 'brizy-api'; 7 const AJAX_GET_POST_INFO = '_get_post_info'; 8 const AJAX_GET = '_editor_get_items'; 9 const AJAX_UPDATE = '_update_item'; 10 const AJAX_GET_PROJECT = '_get_project'; 11 const AJAX_SET_PROJECT = '_set_project'; 12 const AJAX_LOCK_PROJECT = '_lock_project'; 13 const AJAX_MEDIA = '_media'; 14 const AJAX_SIDEBARS = '_sidebars'; 15 const AJAX_SIDEBAR_CONTENT = '_sidebar_content'; 16 const AJAX_SHORTCODE_CONTENT = '_shortcode_content'; 17 const AJAX_PLACEHOLDER_CONTENT = '_placeholder_content'; 18 const AJAX_PLACEHOLDERS_CONTENT = '_placeholders_content'; 19 const AJAX_GET_POST_OBJECTS = '_get_posts'; 20 const AJAX_SEARCH_POST = '_search_posts'; 21 const AJAX_GET_MENU_LIST = '_get_menu_list'; 22 const AJAX_REMOVE_LOCK = '_remove_lock'; 23 const AJAX_HEARTBEAT = '_heartbeat'; 24 const AJAX_TAKE_OVER = '_take_over'; 25 const AJAX_JWT_TOKEN = '_multipass_create'; 26 const AJAX_UPDATE_MENU_DATA = '_update_menu_data'; 27 const AJAX_UPDATE_EDITOR_META_DATA = '_update_editor_meta_data'; 28 const AJAX_UPDATE_MENU_ITEM_DATA = '_update_menu_item_data'; 29 const AJAX_MEDIA_METAKEY = '_get_media_key'; 30 const AJAX_CREATE_ATTACHMENT_UID = '_create_attachment_uid'; 31 const AJAX_SET_FEATURED_IMAGE = '_set_featured_image'; 32 const AJAX_SET_IMAGE_FOCAL_PT = '_set_featured_image_focal_point'; 33 const AJAX_REMOVE_FEATURED_IMAGE = '_remove_featured_image'; 34 const AJAX_TIMESTAMP = '_timestamp'; 35 const AJAX_SET_TEMPLATE_TYPE = '_set_template_type'; 36 const AJAX_GET_USERS = '_get_users'; 37 const AJAX_GET_TERMS = '_get_terms'; 38 const AJAX_GET_TERMS_BY = '_get_terms_by'; 39 const AJAX_GET_POST_TAXONOMIES = '_get_post_taxonomies'; 39 40 const AJAX_GET_ADOBE_FONTS = '_get_adobe_fonts'; 40 41 41 const AJAX_GET_DYNAMIC_CONTENT = '_get_dynamic_content'; 42 43 /** 44 * @var Brizy_Editor_Post 45 */ 46 private $post; 47 48 /** 49 * @return Brizy_Editor_Post 50 */ 51 public function get_post() { 52 return $this->post; 53 } 54 55 /** 56 * Brizy_Editor_API constructor. 57 * 58 * @param Brizy_Editor_Project $project 59 * @param Brizy_Editor_Post $post 60 */ 61 public function __construct( $post ) { 42 const AJAX_GET_DYNAMIC_CONTENT = '_get_dynamic_content'; 43 44 /** 45 * @var Brizy_Editor_Post 46 */ 47 private $post; 48 49 /** 50 * @return Brizy_Editor_Post 51 */ 52 public function get_post() 53 { 54 return $this->post; 55 } 56 57 /** 58 * Brizy_Editor_API constructor. 59 * 60 * @param Brizy_Editor_Project $project 61 * @param Brizy_Editor_Post $post 62 */ 63 public function __construct($post) 64 { 62 65 63 66 $this->post = $post; … … 66 69 } 67 70 68 protected function initializeApiActions() { 69 if ( ! Brizy_Editor_User::is_user_allowed() ) {71 protected function initializeApiActions() 72 {if ( ! Brizy_Editor_User::is_user_allowed() ) { 70 73 return; 71 74 } … … 103 106 add_action($p . 'nopriv_' . Brizy_Editor::prefix(self::AJAX_TIMESTAMP), array($this, 'timestamp')); 104 107 105 } 106 107 protected function getRequestNonce() { 108 return $this->param( 'hash' ); 109 } 110 111 public function addPostTaxonomies() { 108 } 109 110 protected function getRequestNonce() 111 { 112 return $this->param('hash'); 113 } 114 115 public function addPostTaxonomies() 116 { 112 117 113 118 $this->verifyNonce( self::nonce ); … … 131 136 } 132 137 133 public function addDynamicContent() { 134 $this->verifyNonce( self::nonce );138 public function addDynamicContent() 139 {$this->verifyNonce( self::nonce ); 135 140 136 141 $context = Brizy_Content_ContextFactory::createContext( Brizy_Editor_Project::get(), $this->get_post() ); … … 138 143 $placeholders = $provider->getGroupedPlaceholdersForApiResponse(); 139 144 140 return $this->success( $placeholders);141 }142 143 public function lock_project() { 144 $this->verifyNonce( self::nonce );145 return $this->success($placeholders); 146 } 147 148 public function lock_project() 149 {$this->verifyNonce( self::nonce ); 145 150 146 151 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { … … 148 153 } 149 154 155 $editor = new Brizy_Editor_Editor_Editor(Brizy_Editor_Project::get(), null); 156 $this->success($editor->getProjectStatus()); 157 } 158 159 public function removeProjectLock() 160 {$this->verifyNonce( self::nonce ); 161 162 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 163 Brizy_Editor::get()->removeProjectLock(); 164 } 165 166 $editor = new Brizy_Editor_Editor_Editor(Brizy_Editor_Project::get(), null); 167 $this->success($editor->getProjectStatus()); 168 } 169 170 public function heartbeat() 171 {$this->verifyNonce( self::nonce ); 172 173 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 174 Brizy_Editor::get()->lockProject(); 175 } 150 176 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 151 177 $this->success( $editor->getProjectStatus() ); 152 178 } 153 179 154 public function removeProjectLock() { 155 $this->verifyNonce( self::nonce ); 156 157 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 158 Brizy_Editor::get()->removeProjectLock(); 159 } 180 public function takeOver() 181 {$this->verifyNonce( self::nonce ); 182 183 Brizy_Editor::get()->lockProject(); 160 184 161 185 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); … … 163 187 } 164 188 165 public function heartbeat() { 166 $this->verifyNonce( self::nonce ); 167 168 if ( Brizy_Editor::get()->checkIfProjectIsLocked() === false ) { 169 Brizy_Editor::get()->lockProject(); 170 } 171 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 172 $this->success( $editor->getProjectStatus() ); 173 } 174 175 public function takeOver() { 176 $this->verifyNonce( self::nonce ); 177 178 Brizy_Editor::get()->lockProject(); 179 180 $editor = new Brizy_Editor_Editor_Editor( Brizy_Editor_Project::get(), null ); 181 $this->success( $editor->getProjectStatus() ); 182 } 183 184 public function timestamp() { 185 $this->success( array( 'timestamp' => time() ) ); 186 } 187 188 189 public function set_featured_image() { 190 $this->verifyNonce( self::nonce ); 189 public function timestamp() 190 { 191 $this->success(array('timestamp' => time())); 192 } 193 194 195 public function set_featured_image() 196 {$this->verifyNonce( self::nonce ); 191 197 192 198 if ( ! isset( $_REQUEST['attachmentId'] ) ) { … … 202 208 } 203 209 204 $this->error( 400, 'Invalid post');205 }206 207 public function set_featured_image_focal_point() { 208 $this->verifyNonce( self::nonce );210 $this->error(400, 'Invalid post'); 211 } 212 213 public function set_featured_image_focal_point() 214 {$this->verifyNonce( self::nonce ); 209 215 210 216 if ( ! isset( $_REQUEST['attachmentId'] ) || ! isset( $_REQUEST['pointX'] ) || ! isset( $_REQUEST['pointY'] ) ) { … … 212 218 } 213 219 214 if ( $this->post && $this->post->uses_editor()) {220 if ($this->post && $this->post->uses_editor()) { 215 221 216 222 update_post_meta( … … 221 227 'y' => $_REQUEST['pointY'], 222 228 ) 223 );229 ); 224 230 225 231 $this->success( array() ); 226 232 } 227 233 228 $this->error( 400, 'Invalid post');229 }230 231 public function remove_featured_image() { 232 $this->verifyNonce( self::nonce );234 $this->error(400, 'Invalid post'); 235 } 236 237 public function remove_featured_image() 238 {$this->verifyNonce( self::nonce ); 233 239 234 240 if ( $this->post && $this->post->uses_editor() ) { … … 238 244 } 239 245 240 $this->error( 400, 'Invalid post');241 }246 $this->error(400, 'Invalid post'); 247 } 242 248 243 249 … … 297 303 * @internal 298 304 **/ 299 public function get_project() { 300 try { 301 $this->verifyNonce( self::nonce ); 302 $data = Brizy_Editor_Project::get()->createResponse(); 303 $this->success( $data ); 304 } catch ( Exception $exception ) { 305 Brizy_Logger::instance()->exception( $exception ); 306 $this->error( $exception->getCode(), $exception->getMessage() ); 307 } 308 } 309 310 /** 311 * @internal 312 */ 313 public function set_project() { 314 try { 305 public function get_project() 306 { 307 try { 308 $this->verifyNonce(self::nonce); 309 $data = Brizy_Editor_Project::get()->createResponse(); 310 $this->success($data); 311 } catch (Exception $exception) { 312 Brizy_Logger::instance()->exception($exception); 313 $this->error($exception->getCode(), $exception->getMessage()); 314 } 315 } 316 317 /** 318 * @internal 319 */ 320 public function set_project() 321 {try { 315 322 $this->verifyNonce( self::nonce ); 316 323 … … 350 357 } 351 358 352 $this->success( $project->createResponse());353 } catch ( Exception $exception) {354 Brizy_Logger::instance()->exception( $exception);355 $this->error( 400, $exception->getMessage());356 exit;357 }358 }359 360 /**361 * @internal362 **/363 public function get_item() { 364 try {359 $this->success($project->createResponse()); 360 } catch (Exception $exception) { 361 Brizy_Logger::instance()->exception($exception); 362 $this->error(400, $exception->getMessage()); 363 exit; 364 } 365 } 366 367 /** 368 * @internal 369 **/ 370 public function get_item() 371 {try { 365 372 $this->verifyNonce( self::nonce ); 366 373 … … 380 387 } 381 388 382 /**383 * @internal384 **/385 public function get_post_info() { 386 try {389 /** 390 * @internal 391 **/ 392 public function get_post_info() 393 {try { 387 394 $this->verifyNonce( self::nonce ); 388 395 … … 415 422 } 416 423 417 /**418 * @internal419 **/420 public function update_item() { 421 try {424 /** 425 * @internal 426 **/ 427 public function update_item() 428 {try { 422 429 $this->verifyNonce( self::nonce ); 423 430 … … 442 449 } 443 450 444 if ( $compiled) {445 $this->post->set_encoded_compiled_html( $compiled['html'] );451 if ($compiled) { 452 $this->post->set_encoded_compiled_html( $compiled['html'] ); 446 453 $this->post->set_compiled_scripts( [ 447 454 'free' => $compiled['assets']['freeScripts'], 448 'pro' => ( isset( $compiled['assets']['proScripts'] ) ? $compiled['assets']['proScripts'] : [] ),449 ] );450 $this->post->set_compiled_styles( [455 'pro' => ( isset($compiled['assets']['proScripts'] ) ? $compiled['assets']['proScripts'] : [] ), 456 ]); 457 $this->post->set_compiled_styles( [ 451 458 'free' => $compiled['assets']['freeStyles'], 452 459 'pro' => ( isset( $compiled['assets']['proStyles'] ) ? $compiled['assets']['proStyles'] : [] ), … … 467 474 } 468 475 469 if ( $data) {470 $this->post->set_editor_data( $data );476 if ($data) { 477 $this->post->set_editor_data( $data ); 471 478 $this->post->set_editor_version( BRIZY_EDITOR_VERSION ); 472 479 } … … 486 493 } 487 494 488 $this->success( $this->post->createResponse() ); 489 } catch ( Exception $exception ) { 490 Brizy_Logger::instance()->exception( $exception ); 491 $this->error( 500, $exception->getMessage() ); 492 } 493 } 494 495 /* 496 * Used for elements like Woocommerce pages. 497 */ 498 public function shortcode_content() { 499 try { 495 $this->success($this->post->createResponse()); 496 } catch (Exception $exception) { 497 Brizy_Logger::instance()->exception($exception); 498 $this->error(500, $exception->getMessage()); 499 } 500 } 501 502 /* 503 * Used for elements like Woocommerce pages. 504 */ 505 public function shortcode_content() 506 { 507 try { 500 508 501 509 $this->verifyNonce( self::nonce ); … … 515 523 ); 516 524 517 } catch ( Exception $exception) {518 Brizy_Logger::instance()->exception( $exception);519 $this->error( $exception->getCode(), $exception->getMessage());520 }521 }522 523 public function placeholder_content() { 524 try {525 } catch (Exception $exception) { 526 Brizy_Logger::instance()->exception($exception); 527 $this->error($exception->getCode(), $exception->getMessage()); 528 } 529 } 530 531 public function placeholder_content() 532 {try { 525 533 $this->verifyNonce( self::nonce ); 526 534 $postId = $this->param( 'post_id' ); … … 557 565 ) 558 566 ); 559 } catch ( Exception $exception) {560 Brizy_Logger::instance()->exception( $exception);561 $this->error( $exception->getCode(), $exception->getMessage());562 }563 }564 565 public function placeholders_content() { 566 global $post, $wp_query;567 } catch (Exception $exception) { 568 Brizy_Logger::instance()->exception($exception); 569 $this->error($exception->getCode(), $exception->getMessage()); 570 } 571 } 572 573 public function placeholders_content() 574 {global $post, $wp_query; 567 575 try { 568 576 $this->verifyNonce( self::nonce ); … … 594 602 } 595 603 596 private function getPostSample( $templateId ) { 597 global $wp_query;604 private function getPostSample($templateId) 605 {global $wp_query; 598 606 $wp_post = get_post( $templateId ); 599 607 if ( $wp_post->post_type !== Brizy_Admin_Templates::CP_TEMPLATE ) { … … 692 700 ); 693 701 694 $wp_query->is_tax = true;695 }702 $wp_query->is_tax = true; 703 } 696 704 697 705 return array_pop( $terms ); … … 708 716 $posts = $wp_query->get_posts(); 709 717 710 return get_post( array_pop( $posts ));711 }712 $posts = $wp_query->get_posts();718 return get_post(array_pop($posts)); 719 } 720 $posts = $wp_query->get_posts(); 713 721 714 722 return get_post( array_pop( $posts ) );; … … 729 737 $wp_query->is_404 = true; 730 738 731 return null;732 case 'search':733 $wp_query->is_search = true;739 return null; 740 case 'search': 741 $wp_query->is_search = true; 734 742 735 743 return null; … … 769 777 $wp_query->is_day = true; 770 778 771 return null; 772 } 773 } 774 } 775 776 public function get_post_objects() { 779 return null; 780 } 781 } 782 } 783 784 public function get_post_objects() 785 { 777 786 778 787 global $wp_post_types; … … 801 810 } 802 811 803 public function get_sidebars() { 804 global $wp_registered_sidebars;812 public function get_sidebars() 813 {global $wp_registered_sidebars; 805 814 806 815 $this->verifyNonce( self::nonce ); … … 816 825 } 817 826 818 $this->success( $items ); 819 } 820 821 public function brizy_post_title_filter( $where, $wp_query = null ) { 827 $this->success($items); 828 } 829 830 public function brizy_post_title_filter($where, $wp_query = null) 831 { 822 832 823 833 global $wpdb; … … 831 841 } 832 842 833 return $where; 834 } 835 836 public function get_menu_list() { 837 $this->success( wp_get_nav_menus( array( 'hide_empty' => true ) ), 200 ); 838 } 839 840 /** 841 * Used in woocomerce producs, block conditions 842 */ 843 public function get_terms() { 843 return $where; 844 } 845 846 public function get_menu_list() 847 { 848 $this->success(wp_get_nav_menus(array('hide_empty' => true)), 200); 849 } 850 851 /** 852 * Used in woocomerce producs, block conditions 853 */ 854 public function get_terms() 855 { 844 856 845 857 try { … … 852 864 $this->success( array_values( $terms ) ); 853 865 854 } catch ( Exception $e ) { 855 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ] ); 856 $this->error( 500, $e->getMessage() ); 857 } 858 } 859 860 /** 861 * Used in posts filter element 862 */ 863 public function get_terms_by() { 866 } catch (Exception $e) { 867 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 868 $this->error(500, $e->getMessage()); 869 } 870 } 871 872 /** 873 * Used in posts filter element 874 */ 875 public function get_terms_by() 876 { 864 877 865 878 $this->verifyNonce( self::nonce ); … … 891 904 } 892 905 893 $this->success( $out);894 }895 896 /**897 * Used in posts filter element898 */899 public function search_post() { 900 $this->verifyNonce( self::nonce );906 $this->success($out); 907 } 908 909 /** 910 * Used in posts filter element 911 */ 912 public function search_post() 913 {$this->verifyNonce( self::nonce ); 901 914 $args = [ 'numberposts' => - 1 ]; 902 915 $args['post_type'] = array_values( get_post_types( [ 'public' => true ] ) ); … … 957 970 } 958 971 959 $this->success( $out);960 }961 962 public function get_users() { 963 $this->verifyNonce( self::nonce );972 $this->success($out); 973 } 974 975 public function get_users() 976 {$this->verifyNonce( self::nonce ); 964 977 965 978 $args = []; 966 979 $search = $this->param( 'search' ); 967 $include = $this->param( 'include' ); 980 $include = $this->param( 'include' );if (!user_can(get_current_user_id(), 'list_users')) { 981 $this->success([]); 982 } 968 983 969 984 $args['fields'] = [ 'ID', 'display_name' ]; … … 978 993 } 979 994 980 if ( is_array( $include ) && ! empty( $include )) {981 $args['include'] = $include;982 }995 if (is_array($include) && !empty($include)) { 996 $args['include'] = $include; 997 } 983 998 984 999 $users = array_map( … … 995 1010 } 996 1011 997 public function get_media_key() { 998 try {1012 public function get_media_key() 1013 {try { 999 1014 session_write_close(); 1000 1015 $this->verifyNonce( self::nonce ); … … 1009 1024 $this->success( array( 'uid' => $uid ) ); 1010 1025 1011 } catch ( Exception $e) {1012 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ]);1013 1014 return;1015 }1016 }1017 1018 /**1019 * @see Brizy_Admin_Migrations_AttachmentUidMigration1020 */1021 public function get_attachment_key() { 1022 try {1026 } catch (Exception $e) { 1027 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1028 1029 return; 1030 } 1031 } 1032 1033 /** 1034 * @see Brizy_Admin_Migrations_AttachmentUidMigration 1035 */ 1036 public function get_attachment_key() 1037 {try { 1023 1038 session_write_close(); 1024 1039 … … 1047 1062 } 1048 1063 1049 $this->success( array( 'uid' => $uid ) ); 1050 1051 } catch ( Exception $e ) { 1052 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ] ); 1053 1054 return; 1055 } 1056 } 1057 1058 public function setTemplateType() { 1059 try { 1064 $this->success(array('uid' => $uid)); 1065 1066 } catch (Exception $e) { 1067 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1068 1069 return; 1070 } 1071 } 1072 1073 public function setTemplateType() 1074 { 1075 try { 1060 1076 1061 1077 $this->verifyNonce( self::nonce ); … … 1082 1098 $this->success( [] ); 1083 1099 1084 } catch ( Exception $e) {1085 Brizy_Logger::instance()->error( $e->getMessage(), [ $e ]);1086 $this->error( 500, $e->getMessage());1087 1088 return;1089 }1090 }1091 1092 1093 private function createMediaKey( $postId, $attachmentId ) { 1094 $uid = get_post_meta( $attachmentId, 'brizy_attachment_uid', true );1100 } catch (Exception $e) { 1101 Brizy_Logger::instance()->error($e->getMessage(), [$e]); 1102 $this->error(500, $e->getMessage()); 1103 1104 return; 1105 } 1106 } 1107 1108 1109 private function createMediaKey($postId, $attachmentId) 1110 {$uid = get_post_meta( $attachmentId, 'brizy_attachment_uid', true ); 1095 1111 1096 1112 if ( ! $uid ) { … … 1112 1128 } 1113 1129 1114 return $uid;1115 }1116 1117 public function getAdobeFonts() { 1118 $this->checkNonce( self::nonce );1130 return $uid; 1131 } 1132 1133 public function getAdobeFonts() 1134 {$this->checkNonce( self::nonce ); 1119 1135 1120 1136 $manager = new Brizy_Editor_Accounts_ServiceAccountManager( Brizy_Editor_Project::get() ); … … 1139 1155 } 1140 1156 1141 $this->success( json_decode( wp_remote_retrieve_body( $response ), true ));1142 }1157 $this->success(json_decode(wp_remote_retrieve_body($response), true)); 1158 } 1143 1159 } -
brizy/trunk/languages/brizy.pot
r3302199 r3302243 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Brizy 2.6.2 0\n"5 "Project-Id-Version: Brizy 2.6.21\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/workspace\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05-28T1 2:05:49+00:00\n"12 "POT-Creation-Date: 2025-05-28T13:22:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" -
brizy/trunk/readme.txt
r3302199 r3302243 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.2.24 7 Stable tag: 2.6.2 07 Stable tag: 2.6.21 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 133 133 134 134 == Changelog == 135 136 = 2.6.21 - 2025-05-28 = 137 * Fixed: Check if the current user can "list_users" on Posts component 135 138 136 139 = 2.6.20 - 2025-05-28 = -
brizy/trunk/vendor/composer/installed.php
r3302199 r3302243 2 2 'root' => array( 3 3 'name' => 'brizy/brizy', 4 'pretty_version' => 'dev- master',5 'version' => 'dev- master',6 'reference' => ' a6dc4052345338bf7c11578495175283b4e6f9a2',4 'pretty_version' => 'dev-develop', 5 'version' => 'dev-develop', 6 'reference' => '1014ba9c47fb6ec6cb21bdddd30f0c95eeae09be', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 41 41 ), 42 42 'brizy/brizy' => array( 43 'pretty_version' => 'dev- master',44 'version' => 'dev- master',45 'reference' => ' a6dc4052345338bf7c11578495175283b4e6f9a2',43 'pretty_version' => 'dev-develop', 44 'version' => 'dev-develop', 45 'reference' => '1014ba9c47fb6ec6cb21bdddd30f0c95eeae09be', 46 46 'type' => 'library', 47 47 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.