QQWorld Auto Save Images - Version 1.7.13.1

Version Description

Download this release

Release Info

Developer qqworld
Plugin Icon 128x128 QQWorld Auto Save Images
Version 1.7.13.1
Comparing to
See all releases

Code changes from version 1.7.13 to 1.7.13.1

lang/qqworld_auto_save_images-zh_CN.mo CHANGED
Binary file
lang/qqworld_auto_save_images-zh_CN.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: QQworld Auto Save Images\n"
4
  "Report-Msgid-Bugs-To: http://www.qqworld.org\n"
5
- "POT-Creation-Date: 2015-03-25 17:50+0800\n"
6
- "PO-Revision-Date: 2015-03-25 17:50+0800\n"
7
  "Last-Translator: Michael Wang <admin@qqworld.org>\n"
8
  "Language-Team: QQWorld <admin@qqworld.org>\n"
9
  "Language: zh_CN\n"
@@ -453,10 +453,6 @@ msgstr ""
453
  "自动缩小大于该尺寸的图像。如果你想要宽度不超过800px和任意高度图片,请设置宽度"
454
  "800,并设置高度为空。"
455
 
456
- #: qqworld-auto-save-images.php:594
457
- msgid "Your server PHP version lower than 5.4, so this feature not works."
458
- msgstr "服务器PHP的版本低于5.4,所以此功能无法使用。"
459
-
460
  #: qqworld-auto-save-images.php:606 qqworld-auto-save-images.php:608
461
  msgid "Exclude Domain/Keyword"
462
  msgstr "排除域名/关键词"
@@ -871,6 +867,9 @@ msgstr "没有远程图像。"
871
  msgid "Original Link"
872
  msgstr "原始链接"
873
 
 
 
 
874
  #~ msgid "Trial"
875
  #~ msgstr "试用"
876
 
2
  msgstr ""
3
  "Project-Id-Version: QQworld Auto Save Images\n"
4
  "Report-Msgid-Bugs-To: http://www.qqworld.org\n"
5
+ "POT-Creation-Date: 2015-03-29 19:26+0800\n"
6
+ "PO-Revision-Date: 2015-03-29 19:26+0800\n"
7
  "Last-Translator: Michael Wang <admin@qqworld.org>\n"
8
  "Language-Team: QQWorld <admin@qqworld.org>\n"
9
  "Language: zh_CN\n"
453
  "自动缩小大于该尺寸的图像。如果你想要宽度不超过800px和任意高度图片,请设置宽度"
454
  "800,并设置高度为空。"
455
 
 
 
 
 
456
  #: qqworld-auto-save-images.php:606 qqworld-auto-save-images.php:608
457
  msgid "Exclude Domain/Keyword"
458
  msgstr "排除域名/关键词"
867
  msgid "Original Link"
868
  msgstr "原始链接"
869
 
870
+ #~ msgid "Your server PHP version lower than 5.4, so this feature not works."
871
+ #~ msgstr "服务器PHP的版本低于5.4,所以此功能无法使用。"
872
+
873
  #~ msgid "Trial"
874
  #~ msgstr "试用"
875
 
qqworld-auto-save-images.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: QQWorld Auto Save Images
4
  Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
5
  Description: Automatically keep the all remote picture to the local, and automatically set featured image.
6
- Version: 1.7.13
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
@@ -591,14 +591,14 @@ class QQWorld_auto_save_images {
591
  </fieldset></td>
592
  </tr>
593
  <tr valign="top">
594
- <th scope="row"><label><?php _e('Maximum Picture Size', 'qqworld_auto_save_images'); ?></label> <span class="icon help" title="<?php _e("Automatic reduction is greater than the size of the picture. if you want image width less than 800px with any size height, please set width 800 and leave height blank.", 'qqworld_auto_save_images'); ?>"></span><?php if ( !function_exists('getimagesizefromstring') ) : ?> <span class="icon help" title="<?php _e("Your server PHP version lower than 5.4, so this feature not works.", 'qqworld_auto_save_images'); ?>"></span><?php endif; ?></th>
595
  <td><fieldset>
596
  <legend class="screen-reader-text"><span><?php _e('Maximum Picture Size', 'qqworld_auto_save_images'); ?></span></legend>
597
  <label for="qqworld_auto_save_images_maximum_picture_size_width">
598
- <?php _e('Width:', 'qqworld_auto_save_images'); ?> <input name="qqworld_auto_save_images_maximum_picture_size[width]" class="small-text" type="text" id="qqworld_auto_save_images_maximum_picture_size_width" value="<?php echo $this->maximum_picture_size['width']; ?>"<?php if ( !function_exists('getimagesizefromstring') ) echo ' readonly'; ?> /> <?php _e('(px)', 'qqworld_auto_save_images'); ?>
599
  </label><br />
600
  <label for="qqworld_auto_save_images_maximum_picture_size_height">
601
- <?php _e('Height:', 'qqworld_auto_save_images'); ?> <input name="qqworld_auto_save_images_maximum_picture_size[height]" class="small-text" type="text" id="qqworld_auto_save_images_maximum_picture_size_height" value="<?php echo $this->maximum_picture_size['height']; ?>"<?php if ( !function_exists('getimagesizefromstring') ) echo ' readonly'; ?> /> <?php _e('(px)', 'qqworld_auto_save_images'); ?>
602
  </label>
603
  </fieldset></td>
604
  </tr>
@@ -1387,9 +1387,9 @@ class QQWorld_auto_save_images {
1387
  return $filename[count($filename)-1];
1388
  }
1389
 
1390
- public function automatic_reduction($file) {
1391
  $filetype = $this->getFileType($file);
1392
- list($width, $height, $type, $attr) = getimagesizefromstring($file);
1393
  if ((!empty($this->maximum_picture_size['width']) || !empty($this->maximum_picture_size['height'])) && ($width > $this->maximum_picture_size['width'] || $height > $this->maximum_picture_size['height'])) {
1394
  if ($width > $height) {
1395
  $maximum_picture_size_width = empty($this->maximum_picture_size['width']) ? $width*$this->maximum_picture_size['height']/$height : $this->maximum_picture_size['width'];
@@ -1501,7 +1501,7 @@ class QQWorld_auto_save_images {
1501
  }
1502
 
1503
  // Automatic reduction pictures size
1504
- if ( function_exists('getimagesizefromstring') ) list($file, $width, $height) = $this->automatic_reduction($file);
1505
 
1506
  $res=wp_upload_bits($img_name,'',$file);
1507
  if (isset( $res['error'] ) && !empty($res['error'])) return false;
3
  Plugin Name: QQWorld Auto Save Images
4
  Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
5
  Description: Automatically keep the all remote picture to the local, and automatically set featured image.
6
+ Version: 1.7.13.1
7
  Author: Michael Wang
8
  Author URI: http://www.qqworld.org
9
  Text Domain: qqworld_auto_save_images
591
  </fieldset></td>
592
  </tr>
593
  <tr valign="top">
594
+ <th scope="row"><label><?php _e('Maximum Picture Size', 'qqworld_auto_save_images'); ?></label> <span class="icon help" title="<?php _e("Automatic reduction is greater than the size of the picture. if you want image width less than 800px with any size height, please set width 800 and leave height blank.", 'qqworld_auto_save_images'); ?>"></span></th>
595
  <td><fieldset>
596
  <legend class="screen-reader-text"><span><?php _e('Maximum Picture Size', 'qqworld_auto_save_images'); ?></span></legend>
597
  <label for="qqworld_auto_save_images_maximum_picture_size_width">
598
+ <?php _e('Width:', 'qqworld_auto_save_images'); ?> <input name="qqworld_auto_save_images_maximum_picture_size[width]" class="small-text" type="text" id="qqworld_auto_save_images_maximum_picture_size_width" value="<?php echo $this->maximum_picture_size['width']; ?>" /> <?php _e('(px)', 'qqworld_auto_save_images'); ?>
599
  </label><br />
600
  <label for="qqworld_auto_save_images_maximum_picture_size_height">
601
+ <?php _e('Height:', 'qqworld_auto_save_images'); ?> <input name="qqworld_auto_save_images_maximum_picture_size[height]" class="small-text" type="text" id="qqworld_auto_save_images_maximum_picture_size_height" value="<?php echo $this->maximum_picture_size['height']; ?>" /> <?php _e('(px)', 'qqworld_auto_save_images'); ?>
602
  </label>
603
  </fieldset></td>
604
  </tr>
1387
  return $filename[count($filename)-1];
1388
  }
1389
 
1390
+ public function automatic_reduction($file, $image_url) {
1391
  $filetype = $this->getFileType($file);
1392
+ list($width, $height, $type, $attr) = getimagesize($image_url);
1393
  if ((!empty($this->maximum_picture_size['width']) || !empty($this->maximum_picture_size['height'])) && ($width > $this->maximum_picture_size['width'] || $height > $this->maximum_picture_size['height'])) {
1394
  if ($width > $height) {
1395
  $maximum_picture_size_width = empty($this->maximum_picture_size['width']) ? $width*$this->maximum_picture_size['height']/$height : $this->maximum_picture_size['width'];
1501
  }
1502
 
1503
  // Automatic reduction pictures size
1504
+ list($file, $width, $height) = $this->automatic_reduction($file, $image_url);
1505
 
1506
  $res=wp_upload_bits($img_name,'',$file);
1507
  if (isset( $res['error'] ) && !empty($res['error'])) return false;