Plugin Directory

Changeset 2783009


Ignore:
Timestamp:
09/11/2022 06:36:06 PM (4 years ago)
Author:
lruizcode
Message:

Update to version 1.0.1 from GitHub

Location:
bubuku-media-library
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bubuku-media-library/tags/1.0.1/assets/css/admin.css

    r2782825 r2783009  
    99.column-bk_file_size{
    1010    width: 150px;
     11}
     12
     13.bk_file_size_item small{
     14    line-height: 15px;
     15    display: block;
     16    margin: 2px 0 4px;
    1117}
    1218
     
    3541.bk_file_size .bk_btn{
    3642    width: 100%;
     43    padding: 0;
    3744    border: none;
    3845    background: transparent;
     
    4451    height: 30px;
    4552    line-height: 30px;
    46     border-radius: 50px;
     53    border-radius: 3px;
    4754    background: var(--bkml-bg-btn);
    4855    text-align: center;
  • bubuku-media-library/tags/1.0.1/bubuku-media-library.php

    r2782825 r2783009  
    55 * Requires at least: 5.2
    66 * Requires PHP:      7.2
    7  * Version:     1.0.0
     7 * Version:     1.0.1
    88 * Author:      Bubuku
    99 * Author URI:  https://www.bubuku.com/
  • bubuku-media-library/tags/1.0.1/readme.txt

    r2782825 r2783009  
    3333== Changelog ==
    3434
     35= 1.0.1 =
     36* Add calculate message to sort and filter.
     37* Add 'This media is not supported' message in the file size column.
     38
    3539= 1.0.0 =
    3640* Initial release.
  • bubuku-media-library/tags/1.0.1/src/BML_assets.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    3838            BBK_PLUGIN_ASSETS_URL . '/css/admin.css',
    3939            false,
    40             '1.0.0'
     40            '1.0.1'
    4141        );
    4242
  • bubuku-media-library/tags/1.0.1/src/BML_common.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    4545
    4646    public function value_column_file_size( $column_name, $media_id ) {
    47         global $wp_query;
    48         if ( 'bk_file_size' != $column_name || !wp_attachment_is_image( $media_id ) ) {
     47       
     48        if ( 'bk_file_size' != $column_name ) {
    4949          return;
    5050        }
    51    
    52         $orderby = ( isset($wp_query->query['orderby']) ) ? $wp_query->query['orderby'] : '';
    53         $file_size = get_post_meta( $media_id, '_bkml_attachment_file_size', true );
    54        
    55         if ( empty($file_size) && 'bk_file_size' !== $orderby ) {
    56             $file_size = filesize( get_attached_file( $media_id ) );
     51
     52        if ( wp_attachment_is_image( $media_id ) ) {
     53           
     54            echo $this->_view->show_file_size( $media_id );
     55            echo $this->_view->show_file_alt($media_id);
     56
     57        } else {
     58            esc_html_e('This media is not supported.', 'bbkmedialibrary');
    5759        }
    58        
    59        
    60         if ( !empty( $file_size ) ) {
    61    
    62             echo $this->_view->show_file_size( $file_size );
    63    
    64         } else {
    65             echo '<p>   
    66                     <button type="button" class="bk_file_size bk_btn js-calculate" data-id="'. $media_id .'">
    67                         <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
    68                         <span class="bk_loader"></span>
    69                     </button>
    70                 </p>';
    71         }
    72 
    73         echo $this->_view->show_file_alt($media_id);
    7460   
    7561    }
  • bubuku-media-library/tags/1.0.1/src/BML_db.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/tags/1.0.1/src/BML_filter.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/tags/1.0.1/src/BML_plugin.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/tags/1.0.1/src/BML_restapi.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    6565
    6666        if ( $data ) {
    67             $filesize = $this->_view->show_file_size($data);
     67            $filesize = $this->_view->show_file_size($media_id);
    6868            wp_send_json_success(array('filesize' => $filesize));
    6969            die();
  • bubuku-media-library/tags/1.0.1/src/BML_view.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    2929     * @return string
    3030     */
    31     public function show_file_size($file_size) {
     31    public function show_file_size($media_id) {
     32        global $wp_query;
     33
     34        $file_size = get_post_meta( $media_id, '_bkml_attachment_file_size', true );
     35        $is_calculate_filesize = true;
     36       
     37        if ( empty($file_size) ) {
     38            $is_calculate_filesize = false;
     39            $file_size = filesize( get_attached_file( $media_id ) );
     40        }
    3241       
    3342        if ( !empty( $file_size ) ) {
     
    4453
    4554            $file_size = size_format($file_size, 2);
    46             return '<p><span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span></p>';
     55           
     56        }
     57
     58        if ( $is_calculate_filesize ) {
     59            return '<p class="bk_file_size_item">
     60                        <span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span>
     61                    </p>';
     62        } else {
     63           
     64            $orderby = ( isset($wp_query->query['orderby']) ) ? $wp_query->query['orderby'] : '';
     65            $file_size_out = '';
     66            if ( 'bk_file_size' !== $orderby ) {
     67                $file_size_out = '<span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span>';
     68            }
     69
     70            return '<p class="bk_file_size_item">
     71                        '.  $file_size_out .'
     72                        <small>'. esc_html__('In order to sort or filter by size, you need to calculate', 'bbkmedialibrary') .'</small> 
     73                        <button type="button" class="bk_btn js-calculate" data-id="'. $media_id .'">
     74                            <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
     75                            <span class="bk_loader"></span>
     76                        </button>
     77                    </p>';
    4778        }
    4879
  • bubuku-media-library/trunk/assets/css/admin.css

    r2782825 r2783009  
    99.column-bk_file_size{
    1010    width: 150px;
     11}
     12
     13.bk_file_size_item small{
     14    line-height: 15px;
     15    display: block;
     16    margin: 2px 0 4px;
    1117}
    1218
     
    3541.bk_file_size .bk_btn{
    3642    width: 100%;
     43    padding: 0;
    3744    border: none;
    3845    background: transparent;
     
    4451    height: 30px;
    4552    line-height: 30px;
    46     border-radius: 50px;
     53    border-radius: 3px;
    4754    background: var(--bkml-bg-btn);
    4855    text-align: center;
  • bubuku-media-library/trunk/bubuku-media-library.php

    r2782825 r2783009  
    55 * Requires at least: 5.2
    66 * Requires PHP:      7.2
    7  * Version:     1.0.0
     7 * Version:     1.0.1
    88 * Author:      Bubuku
    99 * Author URI:  https://www.bubuku.com/
  • bubuku-media-library/trunk/readme.txt

    r2782825 r2783009  
    3333== Changelog ==
    3434
     35= 1.0.1 =
     36* Add calculate message to sort and filter.
     37* Add 'This media is not supported' message in the file size column.
     38
    3539= 1.0.0 =
    3640* Initial release.
  • bubuku-media-library/trunk/src/BML_assets.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    3838            BBK_PLUGIN_ASSETS_URL . '/css/admin.css',
    3939            false,
    40             '1.0.0'
     40            '1.0.1'
    4141        );
    4242
  • bubuku-media-library/trunk/src/BML_common.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    4545
    4646    public function value_column_file_size( $column_name, $media_id ) {
    47         global $wp_query;
    48         if ( 'bk_file_size' != $column_name || !wp_attachment_is_image( $media_id ) ) {
     47       
     48        if ( 'bk_file_size' != $column_name ) {
    4949          return;
    5050        }
    51    
    52         $orderby = ( isset($wp_query->query['orderby']) ) ? $wp_query->query['orderby'] : '';
    53         $file_size = get_post_meta( $media_id, '_bkml_attachment_file_size', true );
    54        
    55         if ( empty($file_size) && 'bk_file_size' !== $orderby ) {
    56             $file_size = filesize( get_attached_file( $media_id ) );
     51
     52        if ( wp_attachment_is_image( $media_id ) ) {
     53           
     54            echo $this->_view->show_file_size( $media_id );
     55            echo $this->_view->show_file_alt($media_id);
     56
     57        } else {
     58            esc_html_e('This media is not supported.', 'bbkmedialibrary');
    5759        }
    58        
    59        
    60         if ( !empty( $file_size ) ) {
    61    
    62             echo $this->_view->show_file_size( $file_size );
    63    
    64         } else {
    65             echo '<p>   
    66                     <button type="button" class="bk_file_size bk_btn js-calculate" data-id="'. $media_id .'">
    67                         <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
    68                         <span class="bk_loader"></span>
    69                     </button>
    70                 </p>';
    71         }
    72 
    73         echo $this->_view->show_file_alt($media_id);
    7460   
    7561    }
  • bubuku-media-library/trunk/src/BML_db.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/trunk/src/BML_filter.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/trunk/src/BML_plugin.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
  • bubuku-media-library/trunk/src/BML_restapi.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    6565
    6666        if ( $data ) {
    67             $filesize = $this->_view->show_file_size($data);
     67            $filesize = $this->_view->show_file_size($media_id);
    6868            wp_send_json_success(array('filesize' => $filesize));
    6969            die();
  • bubuku-media-library/trunk/src/BML_view.php

    r2782825 r2783009  
    66 * @author     Luis Ruiz <lruiz@bubuku.com>
    77 * @copyright  2022 Bubuku
    8  * @version    1.0.0
     8 * @version    1.0.1
    99 */
    1010
     
    2929     * @return string
    3030     */
    31     public function show_file_size($file_size) {
     31    public function show_file_size($media_id) {
     32        global $wp_query;
     33
     34        $file_size = get_post_meta( $media_id, '_bkml_attachment_file_size', true );
     35        $is_calculate_filesize = true;
     36       
     37        if ( empty($file_size) ) {
     38            $is_calculate_filesize = false;
     39            $file_size = filesize( get_attached_file( $media_id ) );
     40        }
    3241       
    3342        if ( !empty( $file_size ) ) {
     
    4453
    4554            $file_size = size_format($file_size, 2);
    46             return '<p><span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span></p>';
     55           
     56        }
     57
     58        if ( $is_calculate_filesize ) {
     59            return '<p class="bk_file_size_item">
     60                        <span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span>
     61                    </p>';
     62        } else {
     63           
     64            $orderby = ( isset($wp_query->query['orderby']) ) ? $wp_query->query['orderby'] : '';
     65            $file_size_out = '';
     66            if ( 'bk_file_size' !== $orderby ) {
     67                $file_size_out = '<span class="bk_file_size '. esc_html( $file_size_style ) .'">'. esc_html( $file_size ) .'</span>';
     68            }
     69
     70            return '<p class="bk_file_size_item">
     71                        '.  $file_size_out .'
     72                        <small>'. esc_html__('In order to sort or filter by size, you need to calculate', 'bbkmedialibrary') .'</small> 
     73                        <button type="button" class="bk_btn js-calculate" data-id="'. $media_id .'">
     74                            <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
     75                            <span class="bk_loader"></span>
     76                        </button>
     77                    </p>';
    4778        }
    4879
Note: See TracChangeset for help on using the changeset viewer.