Skip to content

Commit

Permalink
Merge pull request #9 from ilovepdf/develop
Browse files Browse the repository at this point in the history
Feature/v2.0.0 (#8)
  • Loading branch information
diegocrombie authored Nov 13, 2023
2 parents ad5e09e + 17537eb commit 6e8c4ad
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 27 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Deploy to WordPress.org
on:
push:
tags:
- "*"
release:
types: [published]
workflow_dispatch:
Expand Down
3 changes: 1 addition & 2 deletions admin/class-ilove-img-compress-media-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ protected function column_cb( $item ) {
* @since 1.0.0
*
* @return array An associative array of column names and their corresponding labels.
* @phpstan-ignore-next-line
*/
public function get_columns() {
$columns = array(
Expand Down Expand Up @@ -254,7 +253,7 @@ public function prepare_items() {
/**
* REQUIRED. We also have to register our pagination options & calculations.
*/
$this->set_pagination_args( // @phpstan-ignore-line
$this->set_pagination_args(
array(
'total_items' => $total_items, // WE have to calculate the total number of items
'per_page' => $per_page, // WE have to determine how many items to show on a page
Expand Down
2 changes: 1 addition & 1 deletion admin/class-ilove-img-compress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Ilove_Img_Compress_Plugin {
* @access public
* @var string VERSION The current version of the plugin.
*/
const VERSION = '1.0.6';
const VERSION = '2.0.0';

/**
* The unique identifier of this plugin.
Expand Down
19 changes: 12 additions & 7 deletions admin/class-ilove-img-compress-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function compress( $images_id ) {

if ( in_array( $_size, $options_compress['iloveimg_field_sizes'], true ) ) {
if ( 'full' === $_size ) {
if ( 'on' === $options_compress['iloveimg_field_resize_full'] ) {
if ( isset( $options_compress['iloveimg_field_resize_full'] ) && 'on' === $options_compress['iloveimg_field_resize_full'] ) {
$metadata = wp_get_attachment_metadata( $images_id );
$editor = wp_get_image_editor( $path_file );

Expand All @@ -114,13 +114,18 @@ public function compress( $images_id ) {
wp_update_attachment_metadata( $images_id, $metadata );
}
}
$my_task = new CompressImageTask( $this->proyect_public, $this->secret_key );
$file = $my_task->addFile( $path_file );
$my_task->execute();
$my_task->download( dirname( $path_file ) );
$my_task = new CompressImageTask( $this->proyect_public, $this->secret_key );
$file = $my_task->addFile( $path_file );
$execute_compress = $my_task->execute();

if ( $images[ $_size ]['compressed'] < $images[ $_size ]['initial'] ) {
$images[ $_size ]['compressed'] = filesize( $path_file );
if ( $execute_compress ) { // @phpstan-ignore-line
$my_task->download( dirname( $path_file ) );

if ( $images[ $_size ]['compressed'] < $images[ $_size ]['initial'] ) {
$images[ $_size ]['compressed'] = filesize( $path_file );
}
} else {
return false;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions admin/views/media-bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
$ilove_img_test_list_table->prepare_items();

?>
<div class="wrap iloveimg_settings"><?php // @phpstan-ignore-line ?>
<img src="<?php echo esc_url( ILOVE_IMG_COMPRESS_PLUGIN_URL . 'assets/images/logo.svg' ); ?>" class="logo" />
<div class="wrap iloveimg_settings">
<img src="<?php echo esc_url( ILOVE_IMG_COMPRESS_PLUGIN_URL . 'assets/images/logo.svg' ); // @phpstan-ignore-line ?>" class="logo" />
<div class="iloveimg_settings__overview">
<?php require_once 'overview.php'; ?>
<?php if ( $ilove_img_test_list_table->total_items ) : ?>
Expand Down
4 changes: 3 additions & 1 deletion ilove-img-compress.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
* Plugin Name: Image Compressor & Optimizer - iLoveIMG
* Plugin URI: https://developer.iloveimg.com/
* Description: Get your images delivered quickly. Now you can get a powerful, easy to use, and reliable image compression plugin for your image optimization needs. With full automation and powerful features, iLoveIMG makes it easy to speed up your website by lightening past and new images with just a click. Compress JPG, PNG and GIF images in your WordPress to improve the positioning of your site, boost visitor’s engagement and ultimately increase sales.
* Version: 1.0.6
* Version: 2.0.0
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: iLoveIMG
* Author URI: https://iloveimg.com/
* License: GPL-2.0+
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
<rule ref="Generic.Commenting.DocComment.MissingShort">
<severity>0</severity>
</rule>
<config name="minimum_wp_version" value="4.6"/>
<config name="minimum_wp_version" value="5.3"/>
</ruleset>
20 changes: 15 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=== Image Compressor & Optimizer - iLoveIMG ===
Plugin Name: Image Compressor & Optimizer - iLoveIMG
Version: 1.0.6
Version: 2.0.0
Author: iLovePDF
Author URI: https://www.iloveimg.com/
Contributors: iLovePDF
Tags: compress, image, optimize, performance, image optimizer
Requires at least: 4.6
Tested up to: 5.8.2
Stable tag: 1.0.6
Requires PHP: 7.1
Requires at least: 5.3
Tested up to: 6.4.1
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -81,6 +81,16 @@ Moreover, all processed files are automatically deleted from our servers after b

== Changelog ==

== 2.0.0 ==
Changed
* Minimum Support WP Version to 5.3
* Minimum Support PHP to 7.4
* Support WP Version 6.4.1

Fixed
* Check if key 'iloveimg_field_resize_full' exist.
* catch processing error for php 8.

= 1.0.6 =
Changed
* Formatting and comment files according to php/wordpress standards.
Expand Down
20 changes: 15 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=== Image Compressor & Optimizer - iLoveIMG ===
Plugin Name: Image Compressor & Optimizer - iLoveIMG
Version: 1.0.6
Version: 2.0.0
Author: iLovePDF
Author URI: https://www.iloveimg.com/
Contributors: iLovePDF
Tags: compress, image, optimize, performance, image optimizer
Requires at least: 4.6
Tested up to: 5.8.2
Stable tag: 1.0.6
Requires PHP: 7.1
Requires at least: 5.3
Tested up to: 6.4.1
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -80,6 +80,16 @@ Moreover, all processed files are automatically deleted from our servers after b

== Changelog ==

== 2.0.0 ==
Changed
* Minimum Support WP Version to 5.3
* Minimum Support PHP to 7.4
* Support WP Version 6.4.1

Fixed
* Check if key 'iloveimg_field_resize_full' exist.
* catch processing error for php 8.

= 1.0.6 =
Changed
* Formatting and comment files according to php/wordpress standards.
Expand Down

0 comments on commit 6e8c4ad

Please sign in to comment.