Plugin Directory

Changeset 2541619


Ignore:
Timestamp:
06/02/2021 10:17:35 PM (5 years ago)
Author:
megaoptim
Message:

Version 1.4.14

Location:
megaoptim-image-optimizer/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • megaoptim-image-optimizer/trunk/assets/css/megaoptim.css

    r2262804 r2541619  
    22 * Misc
    33 */
     4
     5.megaoptim * {
     6    box-sizing: border-box !important;
     7}
     8
     9
    410.megaoptim-container {
    5     max-width: 1200px;
     11    width: 80%;
     12    float: left;
     13}
     14
     15.megaoptim-sidebar {
     16    width: 20%;
     17    float: left;
     18}
     19.megaoptim-sidebar .megaoptim-widget {
     20    background: #fff;
     21    float: left;
     22    width: 100%;
     23    padding: 0;
     24    box-sizing: border-box;
     25    border: 1px solid #e5e5e5;
     26    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
     27}
     28.megaoptim-sidebar .megaoptim-widget-title {
     29    padding: 8px 12px;
     30    border-bottom: 1px solid #e5e5e5;
     31}
     32.megaoptim-sidebar .megaoptim-widget-title h3 {
     33    padding: 0;
     34    margin:0;
     35    font-size: 14px;
     36    line-height: 1.4;
     37}
     38.megaoptim-sidebar .megaoptim-widget-content {
     39    padding: 8px 12px;
     40}
     41.megaoptim-sidebar .megaoptim-widget-content p, .megaoptim-sidebar .megaoptim-widget-content ul {
     42    margin-top: 0;
     43    margin-bottom: 10px;
     44}
     45.megaoptim-sidebar .megaoptim-widget-content p:last-child {
     46    margin-bottom: 0;
     47}
     48
     49.megaoptim-sidebar .megaoptim-widget-content h4 {
     50    margin-top:0;
     51    margin-bottom: 5px;
     52}
     53.megaoptim-widget-resource:last-child {
     54    border-bottom: 0;
     55}
     56
     57.megaoptim-widget-resource {
     58    margin-bottom: 10px;
     59    padding-bottom: 10px;
     60    border-bottom: 1px solid #e5e5e5;
     61}
     62
     63@media(max-width: 768px) {
     64    .megaoptim-container {
     65        width: 100%;
     66        margin-bottom: 20px;
     67    }
     68    .megaoptim-sidebar {
     69        width: 100%;
     70    }
     71
    672}
    773
     
    314380}
    315381
    316 .megaoptim-header-logo {
    317     max-width: 18%;
    318     margin-right: 2%;
    319     padding: 2% 2%;
     382.megaoptim-optimizer-switcher {
     383    padding-top: 3.0%;
     384    padding-bottom: 3.0%;
     385    float: right;
     386}
     387.megaoptim-optimizer-switcher label {
     388    color: #fff;
     389}
     390
     391
     392@media(max-width: 767px) {
     393
     394    .megaoptim-optimizer-switcher {
     395        float:none;
     396        margin: 0 auto;
     397    }
     398
     399    .megaoptim-header-logo {
     400        padding-top: 20px;
     401        width: 100%;
     402    }
     403    .megaoptim-header-logo img {
     404        max-width: 250px !important;
     405    }
     406}
     407@media(min-width: 768px) {
     408    .megaoptim-header-logo {
     409        max-width: 20%;
     410        margin-right: 2%;
     411        padding: 1.6% 1.6%;
     412    }
    320413}
    321414
     
    332425
    333426.megaoptim-menu {
    334     padding-top: 4.7%;
    335     padding-bottom: 4.7%;
     427    padding-top: 3.8%;
     428    padding-bottom: 3.7%;
    336429    margin: 0;
    337430    list-style: none;
     
    666759.megaoptim-table th.column {
    667760    width: auto;
    668 }
    669 
    670 .optimizer-switcher {
    671     padding-top: 3.5%;
    672     padding-bottom: 3.5%;
    673     float: right;
    674 }
    675 
    676 .optimizer-switcher label {
    677     color: #fff;
    678761}
    679762
  • megaoptim-image-optimizer/trunk/includes/classes/Adapters/MGO_FileLibrary.php

    r2539116 r2541619  
    150150            return $result;
    151151        } catch ( Exception $e ) {
    152             throw new MGO_Exception( $e->getMessage() . ' in ' . $e->getFile() );
     152            $attachment_object->unlock();
     153            megaoptim_log( '--- Optimizer Exception: ' . sprintf( '%s in %s', $e->getMessage(), $e->getFile() ) );
     154            throw $e;
    153155        }
    154156    }
  • megaoptim-image-optimizer/trunk/includes/classes/Adapters/MGO_MediaLibrary.php

    r2539116 r2541619  
    231231
    232232            return $result;
    233         } catch ( Exception $e ) {
     233        } catch ( \Exception $e ) {
    234234            $attachment_object->unlock();
    235235            megaoptim_log( '--- Optimizer Exception: ' . sprintf( '%s in %s', $e->getMessage(), $e->getFile() ) );
    236             throw new MGO_Exception( $e->getMessage() );
     236            throw $e;
    237237        }
    238238    }
  • megaoptim-image-optimizer/trunk/includes/classes/MGO_CLI.php

    r2539128 r2541619  
    236236            $total_saved     = 0;
    237237            $total_optimized = 0;
     238            $api_errors      = 0;
    238239            foreach ( $images as $image ) {
    239240                try {
     
    252253                    }
    253254                    \WP_CLI::success( $message );
     255                    $api_errors = 0;
    254256                } catch ( \MGO_Exception $e ) {
    255257                    if ( $e instanceof MGO_Attachment_Already_Optimized_Exception ) {
     
    258260                        \WP_CLI::warning( sprintf( __( 'Attachment %s not optimized. Reason: %s', 'megaoptim-image-optimizer' ), $image['ID'], $e->getMessage() ) );
    259261                    } else if ( $e instanceof MGO_API_Response_Exception ) {
     262                        $api_errors ++;
    260263                        \WP_CLI::warning( sprintf( __( 'Attachment %s not optimized. Reason: %s', 'megaoptim-image-optimizer' ), $image['ID'], $e->getMessage() ) );
    261                         break;
     264                        if ( $api_errors > 10 ) {
     265                            \WP_CLI::error( sprintf( __( 'We found %d consecutive erroneous API responses. Please fix the problem before continuing.' ), $api_errors ) );
     266                            break;
     267                        }
    262268                    } else {
    263269                        \WP_CLI::warning( sprintf( __( 'Attachment %s not optimized. Reason: %s', 'megaoptim-image-optimizer' ), $image['ID'], $e->getMessage() ) );
  • megaoptim-image-optimizer/trunk/includes/compat/nextgen-gallery/classes/MGO_NGGLibrary.php

    r2539116 r2541619  
    170170        } catch ( Exception $e ) {
    171171            $attachment_object->unlock();
    172             megaoptim_log( '--- Optimizer Exception: ' . $e->getMessage() );
    173             throw new MGO_Exception( $e->getMessage() . ' in ' . $e->getFile() );
     172            megaoptim_log( '--- Optimizer Exception: ' . sprintf( '%s in %s', $e->getMessage(), $e->getFile() ) );
     173            throw $e;
    174174        }
    175175    }
  • megaoptim-image-optimizer/trunk/includes/functions/bootstrap.php

    r2202391 r2541619  
    8686    global $wp_version;
    8787    require_once( WP_MEGAOPTIM_LIBRARIES_PATH . 'megaoptim-php' . DIRECTORY_SEPARATOR . 'loadnoncomposer.php' );
     88    $type                                = ( defined( 'WP_CLI' ) && WP_CLI ) ? ' / CLI' . ( defined( 'WP_CLI_VERSION' ) ? ' ' . WP_CLI_VERSION : '' ) : '';
    8889    \MegaOptim\Http\BaseClient::$api_url = WP_MEGAOPTIM_API_BASE_URL;
    89     \MegaOptim\Http\BaseClient::set_user_agent( 'WordPress ' . $wp_version . ' / Plugin ' . WP_MEGAOPTIM_VER );
     90    \MegaOptim\Http\BaseClient::set_user_agent( sprintf( 'WordPress %s / Plugin %s%s', $wp_version, WP_MEGAOPTIM_VER, $type ) );
    9091}
    9192
  • megaoptim-image-optimizer/trunk/includes/functions/helpers.php

    r2432752 r2541619  
    5555        fwrite( $fp, $contents . "\n" );
    5656    }
    57     fclose( $fp );
     57    if ( is_resource( $fp ) ) {
     58        fclose( $fp );
     59    }
    5860}
    5961
     
    697699function megaoptim_get_excluded_custom_dir_paths() {
    698700    $uploads = wp_upload_dir();
     701
    699702    return array( $uploads['basedir'] );
    700703}
  • megaoptim-image-optimizer/trunk/includes/libraries/megaoptim-php/src/Optimizer.php

    r2201007 r2541619  
    213213            $is_file = 0;
    214214            foreach ( $resource as $file ) {
    215 
    216215                if ( file_exists( $file ) && is_file( $file ) ) {
    217216                    $is_file = 1;
  • megaoptim-image-optimizer/trunk/includes/views/parts/footer.php

    r1952089 r2541619  
    1     </div>
    2     </div> <!-- megaoptim-cotnainer -->
     1</div>
     2</div> <!-- megaoptim-cotnainer -->
     3
     4
     5<?php
     6$links = array(
     7    array(
     8        'name'  => __( 'Manage your support', 'megaoptim-image-optimizer' ),
     9        'title' => __( 'Place where you can manage your MegaOptim account, api key and subscription.' ),
     10        'link'  => 'https://app.megaoptim.com/',
     11    ),
     12    array(
     13        'name'  => __( 'Technical support', 'megaoptim-image-optimizer' ),
     14        'title' => __( 'Place where you can manage your MegaOptim account, api key and subscription.', 'megaoptim-image-optimizer' ),
     15        'link'  => 'https://wordpress.org/support/plugin/megaoptim-image-optimizer/',
     16    ),
     17    array(
     18        'name'  => __( 'How to use WP-CLI', 'megaoptim-image-optimizer' ),
     19        'title' => __( 'Learn how to use MegaOptim WP-CLI commands to make your life easier with the command line.', 'megaoptim-image-optimizer' ),
     20        'link'  => 'https://megaoptim.com/blog/how-to-optimize-wordpress-images-with-wp-cli-and-megaoptim/',
     21    ),
     22);
     23?>
     24
     25<div class="megaoptim-sidebar">
     26    <div class="megaoptim-widget">
     27        <div class="megaoptim-widget-title">
     28            <h3><?php _e( 'Resources', 'megaoptim-image-optimizer' ); ?></h3>
     29        </div>
     30        <div class="megaoptim-widget-content">
     31            <div class="megaoptim-widget-resource">
     32                <h4><?php _e( 'Some useful links', 'megaoptim-image-optimizer' ); ?></h4>
     33                <ul>
     34                    <?php
     35                    foreach ( $links as $link ) {
     36                        echo sprintf( '<li><a href="%s" title="%s" target="_blank">%s</a></li>', $link['link'], $link['title'], $link['name'] );
     37                    }
     38                    ?>
     39                </ul>
     40            </div>
     41            <div class="megaoptim-widget-resource">
     42                <h4><?php _e( 'Liked MegaOptim?', 'megaoptim-image-optimizer' ); ?></h4>
     43                <p><?php _e( 'Give us <a target="_blank" href="https://wordpress.org/support/plugin/megaoptim-image-optimizer/reviews/#new-post">5 star rating</a> and <a target="_blank" href="https://megaoptim.com/claim-free-tokens/">claim your <strong>1500 tokens for free</strong></a>', 'megaoptim-image-optimizer' ); ?></p>
     44            </div>
     45        </div>
     46    </div>
     47
     48</div>
     49
     50
    351</div> <!-- .wrap.megaoptim -->
  • megaoptim-image-optimizer/trunk/includes/views/parts/header.php

    r2432752 r2541619  
    4040            <?php elseif ( $menu === 'optimizer' ): ?>
    4141                <div class="megaoptim-header-menu">
    42                     <form class="optimizer-switcher" method="GET" action="<?php echo admin_url( "upload.php" ); ?>">
     42                    <form class="megaoptim-optimizer-switcher" method="GET" action="<?php echo admin_url( "upload.php" ); ?>">
    4343                        <input type="hidden" name="page" value="megaoptim_bulk_optimizer"/>
    4444                        <label for="module"><?php _e( 'Select tool', 'megaoptim-image-optimizer' ); ?></label>
  • megaoptim-image-optimizer/trunk/megaoptim.php

    r2539128 r2541619  
    66Author: MegaOptim
    77Author URI: https://megaoptim.com
    8 Version: 1.4.13
     8Version: 1.4.14
    99Text Domain: megaoptim-image-optimizer
    1010Domain Path: /languages
     
    1515}
    1616
    17 define( 'WP_MEGAOPTIM_VER', '1.4.13' );
     17define( 'WP_MEGAOPTIM_VER', '1.4.14' );
    1818define( 'WP_MEGAOPTIM_PATH', plugin_dir_path( __FILE__ ) );
    1919define( 'WP_MEGAOPTIM_URL', plugin_dir_url( __FILE__ ) );
  • megaoptim-image-optimizer/trunk/readme.txt

    r2539128 r2541619  
    55Tested up to: 5.7
    66Requires PHP: 5.3
    7 Stable tag: 1.4.13
     7Stable tag: 1.4.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 1.4.14 =
     141- Added UI sidebar for links and other information
     142- Added free tokens promo link
     143- Added various responsive UI fixes
     144- Fixed problem with CLI. Allow up to 10 consecutive errors before terminating bulk upload.
     145
    140146= 1.4.13 =
    141147- Terminate the WP CLI Bulk process only if API problem is found e.g. Insufficuent tokens.
Note: See TracChangeset for help on using the changeset viewer.