Plugin Directory

Changeset 3037694


Ignore:
Timestamp:
02/19/2024 06:58:54 AM (2 years ago)
Author:
scaleflex
Message:

4.0.0

Location:
cloudimage
Files:
71 added
7 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • cloudimage/trunk/README.txt

    r2933113 r3037694  
    33Tags: CDN, convert webp, image resizing, optimize images, SEO, resize, fast, compression, optimize, image optimization, image optimizer, optimize, image compression, optimize images, images optimization, optimize images, image compressor, image optimisation, webp
    44Requires PHP: 5.6
    5 Tested up to: 6.2.2
     5Tested up to: 6.4.3
    66Requires at least: 4.8
    7 Stable tag: 3.2.1
     7Stable tag: 4.0.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    334334* Fixed error and tested up to WP version 6.2.2
    335335
     336= 4.0.0 =
     337* Release new version for Cloudimage
     338
    336339== Upgrade Notice ==
    337340* Upgrading from version 1 to 2 or 3 can show you warnings in the admin section
  • cloudimage/trunk/admin/class-cloudimage-admin.php

    r2882955 r3037694  
    202202        $valid = get_option($this->plugin_name);
    203203
    204         if (!isset($_POST['advanced_settings']))
    205         {
     204        if (!isset($_POST['advanced_settings'])) {
    206205            //Cleanup
    207206            if (isset($input['domain'])) {
     
    213212                }
    214213            }
    215          
    216             $switches = ['use_js_powered_mode','use_for_logged_in_users','removes_v7'];
    217         }
    218         else
    219         {
     214
     215            $switches = ['use_js_powered_mode','use_for_logged_in_users','removes_v7', 'new_version'];
     216        } else  {
    220217            $switches = [
    221218                'enable_srcset',
     
    245242            $valid['cloudimage_' . $switch] = empty($input[$switch]) ? ((isset($input['cloudimage_' . $switch]) && $input['cloudimage_' . $switch] == 1) ? 1 : 0) : 1;
    246243        }
    247 
    248244        return $valid;
    249245    }
     
    260256        {
    261257            register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate'));
     258            register_setting(
     259                $this->plugin_name,
     260                'cloudimage_new_version',
     261                [
     262                    'type' => 'boolean',
     263                    'default' => false,
     264                ]
     265            );
    262266        }
    263267    }
  • cloudimage/trunk/admin/css/cloudimage-admin.css

    r2882955 r3037694  
    3838.cloudimg-box {
    3939    box-sizing: border-box;
    40     background: #1352E8;
     40    background: #959595;
    4141    border-radius: 10px;
    4242    color: #fff;
     
    205205    position: relative;
    206206    display: inline-block;
    207     background: #2FB0F7;
     207    background: #155bcd;
    208208    color: white;
    209209    border-radius: 50%;
     
    273273
    274274.cloudimg-box .warning-wrapper {
    275     background: #2FB0F7;
     275    background: #155bcd;
    276276    margin: 1rem 1.5rem;
    277277    border-radius: 10px;
     
    283283    line-height: 1;
    284284    border: none;
    285     background: #1D2690;
     285    background: #155bcd;
    286286    text-transform: uppercase;
    287287    font-weight: bold;
  • cloudimage/trunk/admin/partials/cloudimage-admin-general-display.php

    r2882955 r3037694  
    2525$use_for_logged_in_users = isset($options['cloudimage_use_for_logged_in_users'])
    2626    ? $options['cloudimage_use_for_logged_in_users'] : 1;
    27 
    28 
     27$use_new_version = isset($options['cloudimage_new_version'])
     28    ? $options['cloudimage_new_version'] : 0;
    2929?>
    3030
     
    8181                    <table class="form-table">
    8282                        <tbody>
     83                            <!-- Use new version -->
     84                            <tr id="js-powered-section">
     85                                <th scope="row" class="titledesc">
     86                                    <label for="<?php echo esc_attr($this->plugin_name); ?>-use_new_version">
     87                                        <?php echo "Use new version"; ?>
     88                                        <div class="tooltip">?
     89                                            <span class="tooltiptext"><?php echo "If enabled, you will use the new version of Cloudimage."; ?></span>
     90                                        </div>
     91                                    </label>
     92                                </th>
     93                                <td class="forminp forminp-text general-switch">
     94                                    <label class="switch">
     95                                        <input type="hidden" name="cloudimage_new_version"
     96                                               value="<?php if ($use_new_version) { echo 1; } else { echo 0; } ?>"
     97                                               id="cloudimage_new_version">
     98                                        <input type="checkbox" id="<?php echo esc_attr($this->plugin_name); ?>-new_version"
     99                                               name="<?php echo esc_attr($this->plugin_name); ?>[new_version]" <?php checked($use_new_version, 1); ?> >
     100                                        <span class="slider round"></span>
     101                                    </label>
     102                                </td>
     103                            </tr>
     104
    83105                            <!-- domain -->
    84106                            <tr>
     
    222244        var cloudimage_use_js_powered_mode = jQuery('#cloudimage-use_js_powered_mode');
    223245        var cloudimage_current_mode = jQuery('#cloudimage-current-mode');
     246        var cloudimage_new_version = jQuery('#cloudimage-new_version');
    224247
    225248        //Check if JavaScript is enabled to display lazy loading section
     
    242265        });
    243266
     267        cloudimage_new_version.change(function () {
     268            if (this.checked) {
     269                //If checked - show additional table row with checkbox
     270                // cloudimage_current_mode.text("JS Powered");
     271                jQuery('#cloudimage_new_version').val(1);
     272            } else {
     273                //If turned off - hide the additional table row and unmark the checkbox
     274                // cloudimage_current_mode.text("PHP Powered");
     275                jQuery('#cloudimage_new_version').val(0);
     276            }
     277        });
     278
    244279    });
    245280</script>
  • cloudimage/trunk/cloudimage.php

    r2933113 r3037694  
    11<?php
    2 
    32/**
    4  * Cloudimage - Responsive Images as a Service
     3 * Cloudimage by Scaleflex - Responsive Images as a Service
    54 *
    65 *
     
    1211 * Plugin Name:       Cloudimage - Responsive Images as a Service
    1312 * Description:       The easiest way to <strong>deliver lightning fast images</strong> to your users.
    14  * Version:           3.2.1
     13 * Version:           4.0.0
    1514 * Author:            Cloudimage
    1615 * Author URI:        https://cloudimage.io
     
    2019 * Domain Path:       /languages
    2120 */
     21
    2222
    2323// If this file is called directly, abort.
     
    3030 * Start at version 1.0.0
    3131 */
    32 define('CLOUDIMAGE_VERSION', '3.2.1');
     32define('CLOUDIMAGE_VERSION', '4.0.0');
    3333
    34 /**
    35  * The code that runs during plugin activation.
    36  * This action is documented in includes/class-cloudimage-activator.php
    37  */
    38 function activate_cloudimage()
    39 {
    40     require_once plugin_dir_path(__FILE__) . 'includes/class-cloudimage-activator.php';
    41     Cloudimage_Activator::activate();
     34//get all config of old version
     35$options = get_option('cloudimage');
     36if (!$options) {
     37    $isNewVersion = true;
     38} else {
     39    $isNewVersion = $options['cloudimage_new_version'];
    4240}
    4341
    44 /**
    45  * The code that runs during plugin deactivation.
    46  * This action is documented in includes/class-cloudimage-deactivator.php
    47  */
    48 function deactivate_cloudimage()
    49 {
    50     require_once plugin_dir_path(__FILE__) . 'includes/class-cloudimage-deactivator.php';
    51     Cloudimage_Deactivator::deactivate();
     42if ($isNewVersion) {
     43    require plugin_dir_path(__FILE__) . 'v4/cloudimage.php';
     44} else {
     45    /**
     46     * The code that runs during plugin activation.
     47     * This action is documented in includes/class-cloudimage-activator.php
     48     */
     49    function activate_cloudimage()
     50    {
     51        require_once plugin_dir_path(__FILE__) . 'includes/class-cloudimage-activator.php';
     52        Cloudimage_Activator::activate();
     53    }
     54
     55    /**
     56     * The code that runs during plugin deactivation.
     57     * This action is documented in includes/class-cloudimage-deactivator.php
     58     */
     59    function deactivate_cloudimage()
     60    {
     61        require_once plugin_dir_path(__FILE__) . 'includes/class-cloudimage-deactivator.php';
     62        Cloudimage_Deactivator::deactivate();
     63    }
     64
     65    register_activation_hook(__FILE__, 'activate_cloudimage');
     66    register_deactivation_hook(__FILE__, 'deactivate_cloudimage');
     67
     68    /**
     69     * The core plugin class that is used to define internationalization,
     70     * admin-specific hooks, and public-facing site hooks.
     71     */
     72    require plugin_dir_path(__FILE__) . 'includes/class-cloudimage.php';
     73
     74
     75    /**
     76     * Begins execution of the plugin.
     77     *
     78     * Since everything within the plugin is registered via hooks,
     79     * then kicking off the plugin from this point in the file does
     80     * not affect the page life cycle.
     81     *
     82     * @since    1.0.0
     83     */
     84    function run_cloudimage()
     85    {
     86
     87        $plugin = new Cloudimage();
     88        $plugin->run();
     89
     90    }
     91
     92    run_cloudimage();
    5293}
    5394
    54 register_activation_hook(__FILE__, 'activate_cloudimage');
    55 register_deactivation_hook(__FILE__, 'deactivate_cloudimage');
    56 
    57 /**
    58  * The core plugin class that is used to define internationalization,
    59  * admin-specific hooks, and public-facing site hooks.
    60  */
    61 require plugin_dir_path(__FILE__) . 'includes/class-cloudimage.php';
    62 
    63 
    64 /**
    65  * Begins execution of the plugin.
    66  *
    67  * Since everything within the plugin is registered via hooks,
    68  * then kicking off the plugin from this point in the file does
    69  * not affect the page life cycle.
    70  *
    71  * @since    1.0.0
    72  */
    73 function run_cloudimage()
    74 {
    75 
    76     $plugin = new Cloudimage();
    77     $plugin->run();
    78 
    79 }
    80 
    81 run_cloudimage();
  • cloudimage/trunk/includes/class-cloudimage.php

    r2882955 r3037694  
    7979    public function __construct()
    8080    {
    81 
    8281        if (defined('CLOUDIMAGE_VERSION')) {
    8382            $this->version = CLOUDIMAGE_VERSION;
    8483        } else {
    85             $this->version = '3.0.5';
     84            $this->version = '3.2.1';
    8685        }
    8786        $this->plugin_name = 'cloudimage';
Note: See TracChangeset for help on using the changeset viewer.