Changeset 2997423
- Timestamp:
- 11/17/2023 05:16:35 AM (2 years ago)
- Location:
- fiber-admin
- Files:
-
- 12 edited
- 1 copied
-
tags/3.1.3 (copied) (copied from fiber-admin/trunk)
-
tags/3.1.3/changelog.txt (modified) (1 diff)
-
tags/3.1.3/fiberadmin.php (modified) (1 diff)
-
tags/3.1.3/includes/attachment.php (modified) (1 diff)
-
tags/3.1.3/includes/duplicate.php (modified) (11 diffs)
-
tags/3.1.3/includes/login.php (modified) (2 diffs)
-
tags/3.1.3/readme.txt (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/fiberadmin.php (modified) (1 diff)
-
trunk/includes/attachment.php (modified) (1 diff)
-
trunk/includes/duplicate.php (modified) (11 diffs)
-
trunk/includes/login.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fiber-admin/tags/3.1.3/changelog.txt
r2965072 r2997423 1 1 == Changelog == 2 3 = 3.1.3 = 4 *Release Date - 17 November 2023* 5 6 * Fixed: Fix background image option is not working in While Label. 7 * Fixed: Fix bug duplicate array type in meta fields. 8 * Fixed: Fix bug prevent sanitize filename for unexpected file types. 2 9 3 10 = 3.1.2 = -
fiber-admin/tags/3.1.3/fiberadmin.php
r2965072 r2997423 4 4 * Plugin URI: https://wordpress.org/plugins/fiber-admin/ 5 5 * Description: 💈 Bring multiple customization features to make your own WordPress admin. 6 * Version: 3.1. 26 * Version: 3.1.3 7 7 * Requires at least: 5.2 8 * Requires PHP: 7. 08 * Requires PHP: 7.4 9 9 * Author: Dao 10 10 * Author URI: https://daochau.com/ -
fiber-admin/tags/3.1.3/includes/attachment.php
r2962829 r2997423 38 38 39 39 public function fiad_cleanup_attachment_name($filename, $filename_raw){ 40 $file_extension = pathinfo($filename, PATHINFO_EXTENSION); 41 $exclude_exts = ['css', 'js']; // only apply for media attachment, not for code 42 43 if($file_extension && !in_array($file_extension, $exclude_exts)){ 44 $sanitized_filename = basename($filename, "." . $file_extension); 45 $sanitized_filename = strtolower($sanitized_filename); 40 $file_extension = pathinfo($filename, PATHINFO_EXTENSION); 41 $supported_exts = []; 42 $ext_types = wp_get_ext_types(); 43 $supported_file_types = ['image', 'audio', 'video', 'document', 'spreadsheet']; 44 foreach($supported_file_types as $type){ 45 $supported_exts = array_merge($supported_exts, $ext_types[$type]); 46 } 47 if($file_extension && in_array($file_extension, $supported_exts)){ 48 $sanitized_filename = strtolower(basename($filename, "." . $file_extension)); 46 49 47 50 //handle urlencoded chars -
fiber-admin/tags/3.1.3/includes/duplicate.php
r2689928 r2997423 11 11 public function __construct(){ 12 12 // for non-hierarchy post types 13 add_filter('post_row_actions', array($this, 'fiad_duplicate_link'), 10, 2);13 add_filter('post_row_actions', [$this, 'fiad_duplicate_link'], 10, 2); 14 14 // for hierarchy post types 15 add_filter('page_row_actions', array($this, 'fiad_duplicate_link'), 10, 2);15 add_filter('page_row_actions', [$this, 'fiad_duplicate_link'], 10, 2); 16 16 17 17 // duplicate 18 add_action('admin_action_fiad_duplicate_post_as_draft', array($this, 'fiad_duplicate_post_as_draft'));18 add_action('admin_action_fiad_duplicate_post_as_draft', [$this, 'fiad_duplicate_post_as_draft']); 19 19 20 20 // bulk actions … … 22 22 if($duplicate_post_types){ 23 23 foreach($duplicate_post_types as $post_type){ 24 add_filter('bulk_actions-edit-' . $post_type, array($this, 'fiad_bulk_duplicate'));25 add_filter('handle_bulk_actions-edit-' . $post_type, array(24 add_filter('bulk_actions-edit-' . $post_type, [$this, 'fiad_bulk_duplicate']); 25 add_filter('handle_bulk_actions-edit-' . $post_type, [ 26 26 $this, 27 'fiad_bulk_duplicate_handler' 28 ), 10, 3);27 'fiad_bulk_duplicate_handler', 28 ], 10, 3); 29 29 } 30 30 } 31 31 32 32 // admin notices 33 add_action('admin_notices', array($this, 'fiad_duplicate_admin_notice'));33 add_action('admin_notices', [$this, 'fiad_duplicate_admin_notice']); 34 34 } 35 35 36 36 public function fiad_duplicate_link($actions, $post){ 37 $duplicate_post_types = fiad_get_duplicate_option('exclude_post_types');38 39 37 if(!current_user_can('edit_posts')){ 40 38 return $actions; … … 47 45 48 46 // check duplicate settings 49 $duplicate_enable = false; 47 $duplicate_post_types = fiad_get_duplicate_option('exclude_post_types'); 48 $duplicate_enable = false; 50 49 if(empty($duplicate_post_types)){ 51 50 $duplicate_enable = true; … … 58 57 $url = wp_nonce_url( 59 58 add_query_arg( 60 array(59 [ 61 60 'action' => 'fiad_duplicate_post_as_draft', 62 61 'post' => $post->ID, 63 ),62 ], 64 63 'admin.php' 65 64 ), … … 85 84 if($post){ 86 85 // insert new post 87 $args = array(86 $args = [ 88 87 'comment_status' => $post->comment_status, 89 88 'ping_status' => $post->ping_status, … … 97 96 'post_title' => $post->post_title, 98 97 'post_type' => $post->post_type, 99 'to_ping' => $post->to_ping 100 );98 'to_ping' => $post->to_ping, 99 ]; 101 100 $new_post_id = wp_insert_post($args); 102 101 … … 105 104 if($taxonomies){ 106 105 foreach($taxonomies as $taxonomy){ 107 $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));106 $post_terms = wp_get_object_terms($post_id, $taxonomy, ['fields' => 'slugs']); 108 107 wp_set_object_terms($new_post_id, $post_terms, $taxonomy); 109 108 } … … 113 112 $post_meta = get_post_meta($post_id); 114 113 if($post_meta){ 115 116 114 foreach($post_meta as $meta_key => $meta_values){ 117 118 115 if('_wp_old_slug' == $meta_key){ // exclude special meta key 119 116 continue; … … 121 118 122 119 foreach($meta_values as $meta_value){ 123 add_post_meta($new_post_id, $meta_key, $meta_value);120 add_post_meta($new_post_id, $meta_key, maybe_unserialize($meta_value)); 124 121 } 125 122 } … … 153 150 wp_safe_redirect( 154 151 add_query_arg( 155 array(152 [ 156 153 'post_type' => ('post' !== get_post_type($post) ? get_post_type($post) : false), 157 'saved' => 'fiad_post_duplication_created' 158 ),154 'saved' => 'fiad_post_duplication_created', 155 ], 159 156 admin_url('edit.php') 160 157 ) … … 176 173 177 174 // let's remove query args first 178 $redirect = remove_query_arg( array('fiad_duplicate'), $redirect);175 $redirect = remove_query_arg(['fiad_duplicate'], $redirect); 179 176 180 177 // bulk duplicate -
fiber-admin/tags/3.1.3/includes/login.php
r2727158 r2997423 11 11 public function __construct(){ 12 12 // Login Interface 13 add_action('login_enqueue_scripts', array($this, 'fiad_login_css'));13 add_action('login_enqueue_scripts', [$this, 'fiad_login_css']); 14 14 } 15 15 … … 61 61 if($background_image && !$bg_css){ 62 62 $bg_css = 'body.login{'; 63 $bg_css .= 'background:url( "' . $background_image . '") center / cover no-repeat !important;';63 $bg_css .= 'background:url(' . $background_image . ') center / cover no-repeat !important;'; 64 64 $bg_css .= '}'; 65 65 } -
fiber-admin/tags/3.1.3/readme.txt
r2965072 r2997423 3 3 Tags: white label, admin tool, duplicate post, content protection 4 4 Requires at least: 4.7 5 Tested up to: 6. 3.16 Requires PHP: 7. 07 Stable tag: 3.1. 25 Tested up to: 6.4.1 6 Requires PHP: 7.4 7 Stable tag: 3.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 == Changelog == 48 48 49 = 3.1. 2=50 *Release Date - 1 1 September 2023*49 = 3.1.3 = 50 *Release Date - 17 November 2023* 51 51 52 * Fixed: Fix wrong CSM mode make draft preview blank page.53 * Fixed: Fix CSM meta boxes didn't work.54 * Fixed: Remove unused constant `PAGE_TYPE`.52 * Fixed: Fix background image option is not working in While Label. 53 * Fixed: Fix bug duplicate array type in meta fields. 54 * Fixed: Fix bug prevent sanitize filename for unexpected file types. -
fiber-admin/trunk/changelog.txt
r2965072 r2997423 1 1 == Changelog == 2 3 = 3.1.3 = 4 *Release Date - 17 November 2023* 5 6 * Fixed: Fix background image option is not working in While Label. 7 * Fixed: Fix bug duplicate array type in meta fields. 8 * Fixed: Fix bug prevent sanitize filename for unexpected file types. 2 9 3 10 = 3.1.2 = -
fiber-admin/trunk/fiberadmin.php
r2965072 r2997423 4 4 * Plugin URI: https://wordpress.org/plugins/fiber-admin/ 5 5 * Description: 💈 Bring multiple customization features to make your own WordPress admin. 6 * Version: 3.1. 26 * Version: 3.1.3 7 7 * Requires at least: 5.2 8 * Requires PHP: 7. 08 * Requires PHP: 7.4 9 9 * Author: Dao 10 10 * Author URI: https://daochau.com/ -
fiber-admin/trunk/includes/attachment.php
r2962829 r2997423 38 38 39 39 public function fiad_cleanup_attachment_name($filename, $filename_raw){ 40 $file_extension = pathinfo($filename, PATHINFO_EXTENSION); 41 $exclude_exts = ['css', 'js']; // only apply for media attachment, not for code 42 43 if($file_extension && !in_array($file_extension, $exclude_exts)){ 44 $sanitized_filename = basename($filename, "." . $file_extension); 45 $sanitized_filename = strtolower($sanitized_filename); 40 $file_extension = pathinfo($filename, PATHINFO_EXTENSION); 41 $supported_exts = []; 42 $ext_types = wp_get_ext_types(); 43 $supported_file_types = ['image', 'audio', 'video', 'document', 'spreadsheet']; 44 foreach($supported_file_types as $type){ 45 $supported_exts = array_merge($supported_exts, $ext_types[$type]); 46 } 47 if($file_extension && in_array($file_extension, $supported_exts)){ 48 $sanitized_filename = strtolower(basename($filename, "." . $file_extension)); 46 49 47 50 //handle urlencoded chars -
fiber-admin/trunk/includes/duplicate.php
r2689928 r2997423 11 11 public function __construct(){ 12 12 // for non-hierarchy post types 13 add_filter('post_row_actions', array($this, 'fiad_duplicate_link'), 10, 2);13 add_filter('post_row_actions', [$this, 'fiad_duplicate_link'], 10, 2); 14 14 // for hierarchy post types 15 add_filter('page_row_actions', array($this, 'fiad_duplicate_link'), 10, 2);15 add_filter('page_row_actions', [$this, 'fiad_duplicate_link'], 10, 2); 16 16 17 17 // duplicate 18 add_action('admin_action_fiad_duplicate_post_as_draft', array($this, 'fiad_duplicate_post_as_draft'));18 add_action('admin_action_fiad_duplicate_post_as_draft', [$this, 'fiad_duplicate_post_as_draft']); 19 19 20 20 // bulk actions … … 22 22 if($duplicate_post_types){ 23 23 foreach($duplicate_post_types as $post_type){ 24 add_filter('bulk_actions-edit-' . $post_type, array($this, 'fiad_bulk_duplicate'));25 add_filter('handle_bulk_actions-edit-' . $post_type, array(24 add_filter('bulk_actions-edit-' . $post_type, [$this, 'fiad_bulk_duplicate']); 25 add_filter('handle_bulk_actions-edit-' . $post_type, [ 26 26 $this, 27 'fiad_bulk_duplicate_handler' 28 ), 10, 3);27 'fiad_bulk_duplicate_handler', 28 ], 10, 3); 29 29 } 30 30 } 31 31 32 32 // admin notices 33 add_action('admin_notices', array($this, 'fiad_duplicate_admin_notice'));33 add_action('admin_notices', [$this, 'fiad_duplicate_admin_notice']); 34 34 } 35 35 36 36 public function fiad_duplicate_link($actions, $post){ 37 $duplicate_post_types = fiad_get_duplicate_option('exclude_post_types');38 39 37 if(!current_user_can('edit_posts')){ 40 38 return $actions; … … 47 45 48 46 // check duplicate settings 49 $duplicate_enable = false; 47 $duplicate_post_types = fiad_get_duplicate_option('exclude_post_types'); 48 $duplicate_enable = false; 50 49 if(empty($duplicate_post_types)){ 51 50 $duplicate_enable = true; … … 58 57 $url = wp_nonce_url( 59 58 add_query_arg( 60 array(59 [ 61 60 'action' => 'fiad_duplicate_post_as_draft', 62 61 'post' => $post->ID, 63 ),62 ], 64 63 'admin.php' 65 64 ), … … 85 84 if($post){ 86 85 // insert new post 87 $args = array(86 $args = [ 88 87 'comment_status' => $post->comment_status, 89 88 'ping_status' => $post->ping_status, … … 97 96 'post_title' => $post->post_title, 98 97 'post_type' => $post->post_type, 99 'to_ping' => $post->to_ping 100 );98 'to_ping' => $post->to_ping, 99 ]; 101 100 $new_post_id = wp_insert_post($args); 102 101 … … 105 104 if($taxonomies){ 106 105 foreach($taxonomies as $taxonomy){ 107 $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));106 $post_terms = wp_get_object_terms($post_id, $taxonomy, ['fields' => 'slugs']); 108 107 wp_set_object_terms($new_post_id, $post_terms, $taxonomy); 109 108 } … … 113 112 $post_meta = get_post_meta($post_id); 114 113 if($post_meta){ 115 116 114 foreach($post_meta as $meta_key => $meta_values){ 117 118 115 if('_wp_old_slug' == $meta_key){ // exclude special meta key 119 116 continue; … … 121 118 122 119 foreach($meta_values as $meta_value){ 123 add_post_meta($new_post_id, $meta_key, $meta_value);120 add_post_meta($new_post_id, $meta_key, maybe_unserialize($meta_value)); 124 121 } 125 122 } … … 153 150 wp_safe_redirect( 154 151 add_query_arg( 155 array(152 [ 156 153 'post_type' => ('post' !== get_post_type($post) ? get_post_type($post) : false), 157 'saved' => 'fiad_post_duplication_created' 158 ),154 'saved' => 'fiad_post_duplication_created', 155 ], 159 156 admin_url('edit.php') 160 157 ) … … 176 173 177 174 // let's remove query args first 178 $redirect = remove_query_arg( array('fiad_duplicate'), $redirect);175 $redirect = remove_query_arg(['fiad_duplicate'], $redirect); 179 176 180 177 // bulk duplicate -
fiber-admin/trunk/includes/login.php
r2727158 r2997423 11 11 public function __construct(){ 12 12 // Login Interface 13 add_action('login_enqueue_scripts', array($this, 'fiad_login_css'));13 add_action('login_enqueue_scripts', [$this, 'fiad_login_css']); 14 14 } 15 15 … … 61 61 if($background_image && !$bg_css){ 62 62 $bg_css = 'body.login{'; 63 $bg_css .= 'background:url( "' . $background_image . '") center / cover no-repeat !important;';63 $bg_css .= 'background:url(' . $background_image . ') center / cover no-repeat !important;'; 64 64 $bg_css .= '}'; 65 65 } -
fiber-admin/trunk/readme.txt
r2965072 r2997423 3 3 Tags: white label, admin tool, duplicate post, content protection 4 4 Requires at least: 4.7 5 Tested up to: 6. 3.16 Requires PHP: 7. 07 Stable tag: 3.1. 25 Tested up to: 6.4.1 6 Requires PHP: 7.4 7 Stable tag: 3.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 == Changelog == 48 48 49 = 3.1. 2=50 *Release Date - 1 1 September 2023*49 = 3.1.3 = 50 *Release Date - 17 November 2023* 51 51 52 * Fixed: Fix wrong CSM mode make draft preview blank page.53 * Fixed: Fix CSM meta boxes didn't work.54 * Fixed: Remove unused constant `PAGE_TYPE`.52 * Fixed: Fix background image option is not working in While Label. 53 * Fixed: Fix bug duplicate array type in meta fields. 54 * Fixed: Fix bug prevent sanitize filename for unexpected file types.
Note: See TracChangeset
for help on using the changeset viewer.