├── .travis.yml ├── README.md ├── banner-772x250.jpg ├── banner-772x250.psd ├── bin └── install-wp-tests.sh ├── index.php ├── phpunit.xml.dist ├── readme.txt ├── screenshot-1.jpg ├── screenshot-2.jpg ├── src ├── ImageUploader.php ├── WpAutoUpload.php ├── functions.php ├── lang │ ├── auto-upload-images-de_DE.mo │ ├── auto-upload-images-de_DE.po │ ├── auto-upload-images-es.mo │ ├── auto-upload-images-es.po │ ├── auto-upload-images-fa_IR.mo │ ├── auto-upload-images-fa_IR.po │ ├── auto-upload-images-fr_FR.mo │ ├── auto-upload-images-fr_FR.po │ ├── auto-upload-images-it_IT.mo │ ├── auto-upload-images-it_IT.po │ ├── auto-upload-images-ko_KR.mo │ ├── auto-upload-images-ko_KR.po │ ├── auto-upload-images-ru_RU.mo │ ├── auto-upload-images-ru_RU.po │ ├── auto-upload-images.mo │ └── auto-upload-images.pot └── setting-page.php └── tests ├── bootstrap.php ├── test-ImageUploader.php ├── test-WpAutoUpload.php └── test-plugin-work.php /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | dist: trusty 3 | 4 | language: php 5 | 6 | notifications: 7 | email: 8 | on_success: never 9 | on_failure: always 10 | 11 | branches: 12 | only: 13 | - master 14 | 15 | cache: 16 | directories: 17 | - $HOME/.composer/cache 18 | 19 | matrix: 20 | include: 21 | - php: 7.2 22 | env: WP_VERSION=latest 23 | - php: 7.1 24 | env: WP_VERSION=latest 25 | - php: 7.0 26 | env: WP_VERSION=latest 27 | - php: 5.6 28 | env: WP_VERSION=3.9 29 | - php: 5.6 30 | env: WP_VERSION=latest 31 | - php: 5.6 32 | env: WP_VERSION=trunk 33 | - php: 5.3 34 | env: WP_VERSION=latest 35 | dist: precise 36 | 37 | before_script: 38 | - export PATH="$HOME/.composer/vendor/bin:$PATH" 39 | - | 40 | if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then 41 | phpenv config-rm xdebug.ini 42 | else 43 | echo "xdebug.ini does not exist" 44 | fi 45 | - | 46 | if [[ ! -z "$WP_VERSION" ]] ; then 47 | bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 48 | composer global require "phpunit/phpunit=4.8.*|5.7.*" 49 | fi 50 | 51 | script: 52 | - | 53 | if [[ ! -z "$WP_VERSION" ]] ; then 54 | phpunit 55 | WP_MULTISITE=1 phpunit 56 | fi 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto Upload Images 2 | 3 | [![Build Status](https://travis-ci.com/airani/wp-auto-upload.svg?branch=master)](https://travis-ci.com/airani/wp-auto-upload) 4 | 5 | **Version:** 3.3.2 6 | 7 | **Requires at least:** 2.7 8 | 9 | **Tested up to:** 6.1.1 10 | 11 | **License:** GPLv2 or later 12 | 13 | Automatically detect external images in the post content and import images to your site and adding to the media library and finally replace image urls with new urls. 14 | 15 | ## Description 16 | 17 | When you want to save a post, this plugin search for image urls which exists in post and automatically upload and import external images to the Wordpress upload directory and add images to the media library and then replace new image urls with old urls. 18 | 19 | ### Features 20 | 21 | * Automatically find images in posts and save them to the your server and wp media library 22 | * Update posts with new image urls in your server 23 | * Add images saved by plugin to the Wordpress media library 24 | * Select custom post types for excluding auto upload images 25 | * Choose exclude domain to save images from this domain address 26 | * Choose custom your base url for images 27 | * Choose custom images file name with patterns 28 | * Choose custom image alt name with patterns 29 | * Choose max width and height for images uploaded 30 | 31 | ### Translators 32 | 33 | * English 34 | * Persian (fa_IR) - [Ali Irani](https://irani.im) 35 | * Español (es) - [Diego Herrera](https://github.com/diegoh) 36 | * Russian (ru_RU) - [Артём Рябков](https://github.com/rad96) / [Artur Verenych](https://github.com/a-custom) 37 | * German (de_DE) - [Till Zimmermann](https://github.com/tillz) 38 | * French (fr_FR) - [Malaiac](https://github.com/Malaiac) 39 | * Korean (ko_KR) - [Shodan](https://github.com/luvrei) 40 | * Italian (it_IT) - Patryk Chmura 41 | 42 | ### Links 43 | 44 | * [Official Plugin Page](https://irani.im/wp-auto-upload-images.html) 45 | * [Github Repository](https://github.com/airani/wp-auto-upload) 46 | * [Report Issues](https://github.com/airani/wp-auto-upload/issues/new) 47 | * [Make a Donation](https://irani.im/wp-auto-upload-images.html#donate) 48 | 49 | ## Installation 50 | 51 | Upload the "Auto Upload Images" to plugin directory and Activate it. 52 | To change settings go to "Settings > Auto Upload Images" and change it. 53 | 54 | ## Frequently Asked Questions 55 | 56 | ### Working with Gutenburg editor in wp 3.1 and later? 57 | 58 | Yes, but after save with ajax not show urls immediately in editor. 59 | 60 | ### What is "Base URL" in settings page? 61 | 62 | This URL is used as the new URL image. 63 | 64 | ### What is "Image Name" in settings page? 65 | 66 | You can change the final filename of the image uploaded. 67 | 68 | ### What is "Exclude Domains" in settings page? 69 | 70 | You can exclude many domains from the upload. 71 | 72 | ## Screenshots 73 | 74 | ### 1. Settings page in English language 75 | 76 | ![1. Settings page in English language](https://ps.w.org/auto-upload-images/assets/screenshot-1.png) 77 | 78 | ### 2. Settings page in Persian language 79 | 80 | ![2. Settings page in Persian language](https://ps.w.org/auto-upload-images/assets/screenshot-2.png) 81 | 82 | ## Changelog 83 | 84 | ### 3.3.2 85 | * Add support for `webp` images 86 | * Add `%today_date%`, `%today_day%`, `%post_date%`, `%post_year%`, `%post_month%`, `%post_day%` patterns for image alt and filename 87 | * Fix bug in resolve `%date%` and `%day%` patterns and deprecated these patterns 88 | 89 | ### 3.3.1 90 | * Fix security vulnerability protecting settings form from xss and csrf 91 | 92 | ### 3.3 93 | * Add support urls without schemes 94 | * Add support to showing www if exists in base url #58 95 | * Fix duplicate images in attachments bug reported #59 96 | * Fix bug to download images from some urls #71 97 | * Integrate with Gutenberg editor 98 | * Add Russian translation 99 | 100 | ### 3.2.2 101 | 102 | * Add support for detecting images from "srcset" attribute in img tag 103 | 104 | ### 3.2.1 105 | 106 | * Fixed some important bugs 107 | * Add new feature to reset all options of plugin to defaults settings 108 | * Update with some enhancements in image resizing 109 | 110 | ### 3.2 111 | 112 | * Update with change image downloader 113 | * Update with save post enhancements 114 | * Update integrate with Gutenburg editor 115 | * Fixed mime_content_type error in some cases 116 | * Fixed some minor bugs 117 | * Delete deprecated wp functions 118 | * Add Korean translation 119 | * Add French translation 120 | 121 | ### 3.1.1 122 | 123 | * Fixed critical bug with update to new file structure 124 | 125 | ### 3.1 126 | 127 | * Fixed bug and add support for base url with HTTPS 128 | * Fixed bug in image alt attribute replacement 129 | * Some optimizations and improvements code 130 | * Enhancement in files security access 131 | * Update files structures 132 | * Update setting page styles 133 | * Update screenshot pictures 134 | * Add Information box to setting page 135 | 136 | ### 3.0.1 137 | 138 | * Fixed some bugs 139 | 140 | ### 3.0 141 | 142 | * Add option for customize images alt attribute with defined patterns 143 | * Add option for exclude post types from auto images uploading 144 | * Add `%timestamp%`, `%post_id%`, `%postname%`, `%image_alt%` patterns for custom file names and image alt names. 145 | * Handling image alt attribute 146 | * Change code structures and many important optimizations 147 | * Saving images on upload directory with same post date 148 | * Fixed bugs with uploading images from create new posts by wp restful api 149 | * Fixed some bugs. Thanks to [Sergey Funn](https://github.com/racypepper) 150 | 151 | ### 2.2 152 | 153 | * Added `%random%` pattern for file names. Contributed by [Zdravko Danev](https://github.com/zdanev) 154 | * Added Italian translation. Thanks to Patryk Chmura 155 | 156 | ### 2.1 157 | 158 | * Fixed bug in problem with some urls 159 | 160 | ### 2.0 161 | 162 | * Added option for choosing max width and height of saved images 163 | * Added new shortcodes for custom filenames. `%year%`, `%month%` and `%day%` 164 | * Added error message for "PHP CURL" disabled sites 165 | * Fixed bug in saving Persian and Arabic filename 166 | * Fixed bug in saving image process 167 | * Fixed bug in getting images url 168 | * Many optimizations in code and enhancements performance 169 | 170 | ### 1.6 171 | 172 | * [Fixed] Fixed a bug in replace exclude urls 173 | * [Updated] Some optimize in code 174 | * [Added] Added Español translation. Thanks to [Diegoh](https://github.com/diegoh) 175 | * [Added] Added Russion translation. Thanks to [Артём](https://github.com/rad96) 176 | * [Added] Added German translation. Thanks to [Till](https://github.com/tillz) 177 | 178 | ### 1.5 179 | 180 | * [Updated] Optimize save post 181 | * [Added] Add language files (English, Persian) 182 | * [Added] Add option to choose exclude urls 183 | * [Added] Add option for choosing a custom filename 184 | * [Added] Add option for choosing a custom base url 185 | * [Added] Add settings page 186 | * [Fixed] Fixed for adding image correctly to the media library 187 | 188 | ### 1.4.1 189 | 190 | * [Fixed] Fixed tiny bug ;) Thanks to Ali for reporting bug 191 | 192 | ### 1.4 193 | 194 | * [New Feature] Work With Multi Address Sites 195 | * [Fixed] Work with Persian & Arabic URLs 196 | * [Fixed] Replace URL for images already been uploaded 197 | * Implementation with object-oriented 198 | 199 | ### 1.3 200 | 201 | * Fixed some bugs 202 | 203 | ### 1.2 204 | 205 | * Fixed Bug: Save one revision post 206 | * Fixed Bug: Fix pattern of urls 207 | * Fixed Bug: Save file with same name 208 | * Fixed Bug: More images with same urls in post 209 | * Fixed Bug: Work with ssl urls 210 | 211 | ### 1.1 212 | 213 | * Add image to Media Library and attach to post 214 | * Fix a bug 215 | 216 | ### 1.0 217 | 218 | * It's first version. 219 | -------------------------------------------------------------------------------- /banner-772x250.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/banner-772x250.jpg -------------------------------------------------------------------------------- /banner-772x250.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/banner-772x250.psd -------------------------------------------------------------------------------- /bin/install-wp-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 3 ]; then 4 | echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" 5 | exit 1 6 | fi 7 | 8 | DB_NAME=$1 9 | DB_USER=$2 10 | DB_PASS=$3 11 | DB_HOST=${4-localhost} 12 | WP_VERSION=${5-latest} 13 | SKIP_DB_CREATE=${6-false} 14 | 15 | TMPDIR=${TMPDIR-/tmp} 16 | TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") 17 | WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} 18 | WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} 19 | 20 | download() { 21 | if [ `which curl` ]; then 22 | curl -s "$1" > "$2"; 23 | elif [ `which wget` ]; then 24 | wget -nv -O "$2" "$1" 25 | fi 26 | } 27 | 28 | if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then 29 | WP_BRANCH=${WP_VERSION%\-*} 30 | WP_TESTS_TAG="branches/$WP_BRANCH" 31 | 32 | elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then 33 | WP_TESTS_TAG="branches/$WP_VERSION" 34 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then 35 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 36 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 37 | WP_TESTS_TAG="tags/${WP_VERSION%??}" 38 | else 39 | WP_TESTS_TAG="tags/$WP_VERSION" 40 | fi 41 | elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 42 | WP_TESTS_TAG="trunk" 43 | else 44 | # http serves a single offer, whereas https serves multiple. we only want one 45 | download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json 46 | grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json 47 | LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') 48 | if [[ -z "$LATEST_VERSION" ]]; then 49 | echo "Latest WordPress version could not be found" 50 | exit 1 51 | fi 52 | WP_TESTS_TAG="tags/$LATEST_VERSION" 53 | fi 54 | set -ex 55 | 56 | install_wp() { 57 | 58 | if [ -d $WP_CORE_DIR ]; then 59 | return; 60 | fi 61 | 62 | mkdir -p $WP_CORE_DIR 63 | 64 | if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 65 | mkdir -p $TMPDIR/wordpress-nightly 66 | download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip 67 | unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ 68 | mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR 69 | else 70 | if [ $WP_VERSION == 'latest' ]; then 71 | local ARCHIVE_NAME='latest' 72 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then 73 | # https serves multiple offers, whereas http serves single. 74 | download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json 75 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 76 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 77 | LATEST_VERSION=${WP_VERSION%??} 78 | else 79 | # otherwise, scan the releases and get the most up to date minor version of the major release 80 | local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` 81 | LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) 82 | fi 83 | if [[ -z "$LATEST_VERSION" ]]; then 84 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 85 | else 86 | local ARCHIVE_NAME="wordpress-$LATEST_VERSION" 87 | fi 88 | else 89 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 90 | fi 91 | download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz 92 | tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR 93 | fi 94 | 95 | download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php 96 | } 97 | 98 | install_test_suite() { 99 | # portable in-place argument for both GNU sed and Mac OSX sed 100 | if [[ $(uname -s) == 'Darwin' ]]; then 101 | local ioption='-i.bak' 102 | else 103 | local ioption='-i' 104 | fi 105 | 106 | # set up testing suite if it doesn't yet exist 107 | if [ ! -d $WP_TESTS_DIR ]; then 108 | # set up testing suite 109 | mkdir -p $WP_TESTS_DIR 110 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 111 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data 112 | fi 113 | 114 | if [ ! -f wp-tests-config.php ]; then 115 | download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 116 | # remove all forward slashes in the end 117 | WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") 118 | sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php 119 | sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 120 | sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php 121 | sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php 122 | sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php 123 | fi 124 | 125 | } 126 | 127 | install_db() { 128 | 129 | if [ ${SKIP_DB_CREATE} = "true" ]; then 130 | return 0 131 | fi 132 | 133 | # parse DB_HOST for port or socket references 134 | local PARTS=(${DB_HOST//\:/ }) 135 | local DB_HOSTNAME=${PARTS[0]}; 136 | local DB_SOCK_OR_PORT=${PARTS[1]}; 137 | local EXTRA="" 138 | 139 | if ! [ -z $DB_HOSTNAME ] ; then 140 | if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then 141 | EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" 142 | elif ! [ -z $DB_SOCK_OR_PORT ] ; then 143 | EXTRA=" --socket=$DB_SOCK_OR_PORT" 144 | elif ! [ -z $DB_HOSTNAME ] ; then 145 | EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" 146 | fi 147 | fi 148 | 149 | # create database 150 | mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA 151 | } 152 | 153 | install_wp 154 | install_test_suite 155 | install_db 156 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | run(); 24 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | ./tests/ 13 | ./tests/test-sample.php 14 | 15 | 16 | 17 | 18 | ./src 19 | ./index.php 20 | 21 | ./src/lang 22 | ./tests 23 | ./src/setting-page.php 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Auto Upload Images === 2 | Contributors: airani 3 | Donate link: https://irani.im/wp-auto-upload-images.html#donate 4 | Tags: upload, auto, automatically, image, images, admin, administrator, post, save, media, automation, editor, filter 5 | Requires at least: 2.7 6 | Tested up to: 6.1.1 7 | Stable tag: 3.3.2 8 | License: GPLv2 or later 9 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 | 11 | Automatically detect external images in the post content and import images to your site then adding to the media library and replace image urls. 12 | 13 | == Description == 14 | 15 | When you want to save a post, this plugin search for image urls which exists in post and automatically upload and import external images to the Wordpress upload directory and add images to the media library and then replace new image urls with old urls. 16 | 17 | = Features = 18 | 19 | * Automatically find images in posts and save them to the your server and wp media library 20 | * Update posts with new image urls in your server 21 | * Add images saved by plugin to the Wordpress media library 22 | * Select custom post types for excluding auto upload images 23 | * Choose exclude domain to save images from this domain address 24 | * Choose custom your base url for images 25 | * Choose custom images file name with patterns 26 | * Choose custom image alt name with patterns 27 | * Choose max width and height for images uploaded 28 | 29 | 30 | = Translators = 31 | 32 | * English 33 | * Persian (fa_IR) - [Ali Irani](https://irani.im) 34 | * Español (es) - [Diego Herrera](https://github.com/diegoh) 35 | * Russion (ru_RU) - [Артём Рябков](https://github.com/rad96) 36 | * German (de_DE) - [Till Zimmermann](https://github.com/tillz) 37 | * French (fr_FR) - [Malaiac](https://github.com/Malaiac) 38 | * Korean (ko_KR) - [Shodan](https://github.com/luvrei) 39 | * Italian (it_IT) - Patryk Chmura 40 | 41 | 42 | = Links = 43 | 44 | * [Official Plugin Page](https://irani.im/wp-auto-upload-images.html) 45 | * [Github Repository](https://github.com/airani/wp-auto-upload) 46 | * [Report Issues](https://github.com/airani/wp-auto-upload/issues/new) 47 | * [Make a Donation](https://irani.im/wp-auto-upload-images.html#donate) 48 | 49 | == Installation == 50 | 51 | Upload the "Auto Upload Images" to plugin directory and Activate it. 52 | To change settings go to "Settings > Auto Upload Images" and change it. 53 | 54 | == Frequently Asked Questions == 55 | 56 | = Working with Gutenburg editor in wp 3.1 and later? = 57 | Yes, but after save with ajax not show urls immediately in editor. 58 | 59 | 60 | = What is "Base URL" in settings page? = 61 | This URL is used as the new URL image. 62 | 63 | = What is "Image Name" in settings page? = 64 | You can change the final filename of the image uploaded. 65 | 66 | = What is "Exclude Domains" in settings page? = 67 | You can exclude many domains from the upload. 68 | 69 | == Screenshots == 70 | 71 | 1. Settings page in English language 72 | 2. Settings page in Persian language 73 | 74 | == Changelog == 75 | 76 | = 3.3.2 = 77 | * Add support for `webp` images 78 | * Add `%today_date%`, `%today_day%`, `%post_date%`, `%post_year%`, `%post_month%`, `%post_day%` patterns for image alt and filename 79 | * Fix bug in resolve `%date%` and `%day%` patterns and deprecated these patterns 80 | 81 | = 3.3.1 = 82 | * Fix security vulnerability protecting settings form from xss and csrf 83 | 84 | = 3.3 = 85 | * Add support urls without schemes 86 | * Add support to showing www if exists in base url #58 87 | * Fix duplicate images in attachments bug reported #59 88 | * Fix bug to download images from some urls #71 89 | * Integrate with Gutenberg editor 90 | * Add Russian translation 91 | 92 | = 3.2.2 = 93 | * Add support for detecting images from "srcset" attribute in img tag 94 | 95 | = 3.2.1 = 96 | * Fixed some important bugs 97 | * Add new feature to reset all options of plugin to defaults settings 98 | * Update with some enhancements in image resizing 99 | 100 | = 3.2 = 101 | * Update with change image downloader 102 | * Update with save post enhancements 103 | * Update integrate with Gutenburg editor 104 | * Fixed mime_content_type error in some cases 105 | * Fixed some minor bugs 106 | * Delete deprecated wp functions 107 | * Add Korean translation 108 | * Add French translation 109 | 110 | = 3.1.1 = 111 | * Fixed critical bug with update to new file structure 112 | 113 | = 3.1 = 114 | * Fixed bug and add support for base url with HTTPS 115 | * Fixed bug in image alt attribute replacement 116 | * Some optimizations and improvements code 117 | * Enhancement in files security access 118 | * Update files structures 119 | * Update setting page styles 120 | * Update screenshot pictures 121 | * Add Information box to setting page 122 | 123 | = 3.0.1 = 124 | * Fixed some bugs 125 | 126 | = 3.0 = 127 | * Add option for customize images alt attribute with defined patterns 128 | * Add option for exclude post types from auto images uploading 129 | * Add `%timestamp%`, `%post_id%`, `%postname%`, `%image_alt%` patterns for custom file names and image alt names. 130 | * Handling image alt attribute 131 | * Change code structures and many important optimizations 132 | * Saving images on upload directory with same post date 133 | * Fixed bugs with uploading images from create new posts by wp restful api 134 | * Fixed some bugs. Thanks to [Sergey Funn](https://github.com/racypepper) 135 | 136 | = 2.2 = 137 | * Added `%random%` pattern for file names. Contributed by [Zdravko Danev](https://github.com/zdanev) 138 | * Added Italian translation. Thanks to Patryk Chmura 139 | 140 | = 2.1 = 141 | * Fixed bug in problem with some urls 142 | 143 | = 2.0 = 144 | * Added option for choosing max width and height of saved images 145 | * Added new shortcodes for custom filenames. `%year%`, `%month%` and `%day%` 146 | * Added error message for "PHP CURL" disabled sites 147 | * Fixed bug in saving Persian and Arabic filename 148 | * Fixed bug in saving image process 149 | * Fixed bug in getting images url 150 | * Many optimizations in code and enhancements performance 151 | 152 | = 1.6 = 153 | * [Fixed] Fixed a bug in replace exclude urls 154 | * [Updated] Some optimize in code 155 | * [Added] Added Español translation. Thanks to [Diegoh](https://github.com/diegoh) 156 | * [Added] Added Russion translation. Thanks to [Артём](https://github.com/rad96) 157 | * [Added] Added German translation. Thanks to [Till](https://github.com/tillz) 158 | 159 | = 1.5 = 160 | * [Updated] Optimize save post 161 | * [Added] Add language files (English, Persian) 162 | * [Added] Add option to choose exclude urls 163 | * [Added] Add option for choosing a custom filename 164 | * [Added] Add option for choosing a custom base url 165 | * [Added] Add settings page 166 | * [Fixed] Fixed for adding image correctly to the media library 167 | 168 | = 1.4.1 = 169 | * [Fixed] Fixed tiny bug ;) Thanks to Ali for reporting bug 170 | 171 | = 1.4 = 172 | * [New Feature] Work With Multi Address Sites 173 | * [Fixed] Work with Persian & Arabic URLs 174 | * [Fixed] Replace URL for images already been uploaded 175 | * Implementation with object-oriented 176 | 177 | = 1.3 = 178 | * Fixed some bugs 179 | 180 | = 1.2 = 181 | * Fixed Bug: Save one revision post 182 | * Fixed Bug: Fix pattern of urls 183 | * Fixed Bug: Save file with same name 184 | * Fixed Bug: More images with same urls in post 185 | * Fixed Bug: Work with ssl urls 186 | 187 | = 1.1 = 188 | * Add image to Media Library and attach to post 189 | * Fix a bug 190 | 191 | = 1.0 = 192 | * It's first version. 193 | -------------------------------------------------------------------------------- /screenshot-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/screenshot-1.jpg -------------------------------------------------------------------------------- /screenshot-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/screenshot-2.jpg -------------------------------------------------------------------------------- /src/ImageUploader.php: -------------------------------------------------------------------------------- 1 | 5 | */ 6 | class ImageUploader 7 | { 8 | public $post; 9 | public $url; 10 | public $alt; 11 | 12 | public function __construct($url, $alt, $post) 13 | { 14 | $this->post = $post; 15 | $this->url = $url; 16 | $this->alt = $alt; 17 | } 18 | 19 | /** 20 | * Return host of url 21 | * @param null|string $url 22 | * @param bool $scheme 23 | * @param bool $www 24 | * @return null|string 25 | */ 26 | public static function getHostUrl($url = null, $scheme = false, $www = false) 27 | { 28 | $url = $url ?: WpAutoUpload::getOption('base_url'); 29 | 30 | $urlParts = parse_url($url); 31 | 32 | if (array_key_exists('host', $urlParts) === false) { 33 | return null; 34 | } 35 | 36 | $host = array_key_exists('port', $urlParts) ? $urlParts['host'] . ":" . $urlParts['port'] : $urlParts['host']; 37 | if (!$www) { 38 | $withoutWww = preg_split('/^(www(2|3)?\.)/i', $host, -1, PREG_SPLIT_NO_EMPTY); // Delete www from host 39 | $host = is_array($withoutWww) && array_key_exists(0, $withoutWww) ? $withoutWww[0] : $host; 40 | } 41 | return $scheme && array_key_exists('scheme', $urlParts) ? $urlParts['scheme'] . '://' . $host : $host; 42 | } 43 | 44 | /** 45 | * Check url is allowed to upload or not 46 | * @return bool 47 | */ 48 | public function validate() 49 | { 50 | $url = self::getHostUrl($this->url); 51 | $site_url = self::getHostUrl() === null ? self::getHostUrl(site_url('url')) : self::getHostUrl(); 52 | 53 | if ($url === $site_url || !$url) { 54 | return false; 55 | } 56 | 57 | if ($urls = WpAutoUpload::getOption('exclude_urls')) { 58 | $exclude_urls = explode("\n", $urls); 59 | 60 | foreach ($exclude_urls as $exclude_url) { 61 | if ($url === self::getHostUrl(trim($exclude_url))) { 62 | return false; 63 | } 64 | } 65 | } 66 | 67 | return true; 68 | } 69 | 70 | /** 71 | * Return custom image filename with user rules 72 | * @return string 73 | */ 74 | protected function getFilename() 75 | { 76 | $filename = trim($this->resolvePattern(WpAutoUpload::getOption('image_name', '%filename%'))); 77 | return sanitize_file_name($filename ?: uniqid('img_', false)); 78 | } 79 | 80 | /** 81 | * Returns original image filename if valid 82 | * @return string|null 83 | */ 84 | protected function getOriginalFilename() 85 | { 86 | $urlParts = pathinfo($this->url); 87 | 88 | if (!isset($urlParts['filename'])) { 89 | return null; 90 | } 91 | 92 | return sanitize_file_name($urlParts['filename']); 93 | } 94 | 95 | private $_uploadDir; 96 | 97 | /** 98 | * Return information of upload directory 99 | * fields: path, url, subdir, basedir, baseurl 100 | * @param $field 101 | * @return string|null 102 | */ 103 | protected function getUploadDir($field) 104 | { 105 | if ($this->_uploadDir === null) { 106 | $this->_uploadDir = wp_upload_dir(date('Y/m', time())); 107 | } 108 | return is_array($this->_uploadDir) && array_key_exists($field, $this->_uploadDir) ? $this->_uploadDir[$field] : null; 109 | } 110 | 111 | /** 112 | * Return custom alt name with user rules 113 | * @return string Custom alt name 114 | */ 115 | public function getAlt() 116 | { 117 | return $this->resolvePattern(WpAutoUpload::getOption('alt_name')); 118 | } 119 | 120 | /** 121 | * Returns string patterned 122 | * @param $pattern 123 | * @return string 124 | */ 125 | public function resolvePattern($pattern) 126 | { 127 | preg_match_all('/%[^%]*%/', $pattern, $rules); 128 | 129 | $patterns = array( 130 | '%filename%' => $this->getOriginalFilename(), 131 | '%image_alt%' => $this->alt, 132 | '%date%' => date('Y-m-j'), // deprecated 133 | '%today_date%' => date('Y-m-j'), 134 | '%year%' => date('Y'), 135 | '%month%' => date('m'), 136 | '%day%' => date('j'), // deprecated 137 | '%today_day%' => date('j'), 138 | '%post_date%' => date('Y-m-j', strtotime($this->post['post_date_gmt'])), 139 | '%post_year%' => date('Y', strtotime($this->post['post_date_gmt'])), 140 | '%post_month%' => date('m', strtotime($this->post['post_date_gmt'])), 141 | '%post_day%' => date('j', strtotime($this->post['post_date_gmt'])), 142 | '%url%' => self::getHostUrl(get_bloginfo('url')), 143 | '%random%' => uniqid('img_', false), 144 | '%timestamp%' => time(), 145 | '%post_id%' => $this->post['ID'], 146 | '%postname%' => $this->post['post_name'], 147 | ); 148 | 149 | if ($rules[0]) { 150 | foreach ($rules[0] as $rule) { 151 | $pattern = preg_replace("/$rule/", array_key_exists($rule, $patterns) ? $patterns[$rule] : $rule, $pattern); 152 | } 153 | } 154 | 155 | return $pattern; 156 | } 157 | 158 | /** 159 | * Save image and validate 160 | * @return null|array image data 161 | */ 162 | public function save() 163 | { 164 | if (!$this->validate()) { 165 | return null; 166 | } 167 | 168 | $image = $this->downloadImage($this->url); 169 | 170 | if (is_wp_error($image)) { 171 | return null; 172 | } 173 | 174 | return $image; 175 | } 176 | 177 | /** 178 | * Download image 179 | * @param $url 180 | * @return array|WP_Error 181 | */ 182 | public function downloadImage($url) 183 | { 184 | $url = self::normalizeUrl($url); 185 | $args = [ 186 | 'user-agent' => '' 187 | ]; 188 | $parsedUrl = parse_url($url); 189 | if (isset($parsedUrl['host'])){ 190 | $args['headers']['host'] = $parsedUrl['host']; 191 | } 192 | $response = wp_remote_get($url, $args); 193 | 194 | if ($response instanceof WP_Error) { 195 | return $response; 196 | } 197 | 198 | if (isset($response['response']['code'], $response['body']) && $response['response']['code'] !== 200) { 199 | return new WP_Error('aui_download_failed', 'AUI: Image file bad response.'); 200 | } 201 | 202 | $tempFile = tempnam(sys_get_temp_dir(), 'WP_AUI'); 203 | file_put_contents($tempFile, $response['body']); 204 | $mime = wp_get_image_mime($tempFile); 205 | unlink($tempFile); 206 | 207 | if ($mime === false || strpos($mime, 'image/') !== 0) { 208 | return new WP_Error('aui_invalid_file', 'AUI: File type is not image.'); 209 | } 210 | 211 | $image = []; 212 | $image['mime_type'] = $mime; 213 | $image['ext'] = self::getExtension($mime); 214 | $image['filename'] = $this->getFilename() . '.' . $image['ext']; 215 | $image['base_path'] = rtrim($this->getUploadDir('path'), DIRECTORY_SEPARATOR); 216 | $image['base_url'] = rtrim($this->getUploadDir('url'), '/'); 217 | $image['path'] = $image['base_path'] . DIRECTORY_SEPARATOR . $image['filename']; 218 | $image['url'] = $image['base_url'] . '/' . $image['filename']; 219 | $c = 1; 220 | 221 | $sameFileExists = false; 222 | while (is_file($image['path'])) { 223 | if (sha1($response['body']) === sha1_file($image['path'])) { 224 | $sameFileExists = true; 225 | break; 226 | } 227 | 228 | $image['path'] = $image['base_path'] . DIRECTORY_SEPARATOR . $c . '_' . $image['filename']; 229 | $image['url'] = $image['base_url'] . '/' . $c . '_' . $image['filename']; 230 | $c++; 231 | } 232 | 233 | if ($sameFileExists) { 234 | return $image; 235 | } 236 | 237 | file_put_contents($image['path'], $response['body']); 238 | 239 | if (!is_file($image['path'])) { 240 | return new WP_Error('aui_image_save_failed', 'AUI: Image save to upload dir failed.'); 241 | } 242 | 243 | $this->attachImage($image); 244 | 245 | if ($this->isNeedToResize() && ($resized = $this->resizeImage($image))) { 246 | $image['url'] = $resized['url']; 247 | $image['path'] = $resized['path']; 248 | $this->attachImage($image); 249 | } 250 | 251 | return $image; 252 | } 253 | 254 | /** 255 | * Attach image to post and media management 256 | * @param array $image 257 | * @return bool|int 258 | */ 259 | public function attachImage($image) 260 | { 261 | $attachment = array( 262 | 'guid' => $image['url'], 263 | 'post_mime_type' => $image['mime_type'], 264 | 'post_title' => $this->alt ?: preg_replace('/\.[^.]+$/', '', $image['filename']), 265 | 'post_content' => '', 266 | 'post_status' => 'inherit' 267 | ); 268 | $attach_id = wp_insert_attachment($attachment, $image['path'], $this->post['ID']); 269 | if (!function_exists('wp_generate_attachment_metadata')) { 270 | include_once( ABSPATH . 'wp-admin/includes/image.php' ); 271 | } 272 | $attach_data = wp_generate_attachment_metadata($attach_id, $image['path']); 273 | 274 | return wp_update_attachment_metadata($attach_id, $attach_data); 275 | } 276 | 277 | /** 278 | * Resize image and returns resized url 279 | * @param $image 280 | * @return false|array 281 | */ 282 | public function resizeImage($image) 283 | { 284 | $width = WpAutoUpload::getOption('max_width'); 285 | $height = WpAutoUpload::getOption('max_height'); 286 | $image_resized = image_make_intermediate_size($image['path'], $width, $height); 287 | 288 | if (!$image_resized) { 289 | return false; 290 | } 291 | 292 | return array( 293 | 'url' => $image['base_url'] . '/' . urldecode($image_resized['file']), 294 | 'path' => $image['base_path'] . DIRECTORY_SEPARATOR . urldecode($image_resized['file']), 295 | ); 296 | } 297 | 298 | /** 299 | * Check image need to resize or not 300 | * @return bool 301 | */ 302 | public function isNeedToResize() 303 | { 304 | return WpAutoUpload::getOption('max_width') || WpAutoUpload::getOption('max_height'); 305 | } 306 | 307 | /** 308 | * Returns Image file extension by mime type 309 | * @param $mime 310 | * @return string|null 311 | */ 312 | public static function getExtension($mime) 313 | { 314 | $mimes = array( 315 | 'image/jpeg' => 'jpg', 316 | 'image/png' => 'png', 317 | 'image/gif' => 'gif', 318 | 'image/bmp' => 'bmp', 319 | 'image/tiff' => 'tif', 320 | 'image/webp' => 'webp', 321 | ); 322 | 323 | return array_key_exists($mime, $mimes) ? $mimes[$mime] : null; 324 | } 325 | 326 | /** 327 | * @param $url 328 | * @return string 329 | */ 330 | public static function normalizeUrl($url) 331 | { 332 | if (preg_match('/^\/\/.*$/', $url)) { 333 | return 'https:' . $url; 334 | } 335 | return $url; 336 | } 337 | } 338 | -------------------------------------------------------------------------------- /src/WpAutoUpload.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class WpAutoUpload 12 | { 13 | const WP_OPTIONS_KEY = 'aui-setting'; 14 | 15 | private static $_options; 16 | 17 | /** 18 | * WP_Auto_Upload Run. 19 | * Set default variables and options 20 | * Add wordpress actions 21 | */ 22 | public function run() 23 | { 24 | add_action('plugins_loaded', array($this, 'initTextdomain')); 25 | add_action('admin_menu', array($this, 'addAdminMenu')); 26 | 27 | add_filter('wp_insert_post_data', array($this, 'savePost'), 10, 2); 28 | } 29 | 30 | /** 31 | * Initial plugin textdomain for translation files 32 | */ 33 | public function initTextdomain() 34 | { 35 | load_plugin_textdomain('auto-upload-images', false, basename(WPAUI_DIR) . '/src/lang'); 36 | } 37 | 38 | /** 39 | * Automatically upload external images of a post to Wordpress upload directory 40 | * call by wp_insert_post_data filter 41 | * @param array data An array of slashed post data 42 | * @param array $postarr An array of sanitized, but otherwise unmodified post data 43 | * @return array $data 44 | */ 45 | public function savePost($data, $postarr) 46 | { 47 | if (wp_is_post_revision($postarr['ID']) || 48 | wp_is_post_autosave($postarr['ID']) || 49 | (defined('DOING_AJAX') && DOING_AJAX) || 50 | (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) { 51 | return $data; 52 | } 53 | 54 | if ($content = $this->save($postarr)) { 55 | $data['post_content'] = $content; 56 | } 57 | return $data; 58 | } 59 | 60 | /** 61 | * Upload images and save new urls 62 | * @return string filtered content 63 | */ 64 | public function save($postarr) 65 | { 66 | $excludePostTypes = self::getOption('exclude_post_types'); 67 | if (is_array($excludePostTypes) && in_array($postarr['post_type'], $excludePostTypes, true)) { 68 | return false; 69 | } 70 | 71 | $content = $postarr['post_content']; 72 | $images = $this->findAllImageUrls(stripslashes($content)); 73 | 74 | if (count($images) == 0) { 75 | return false; 76 | } 77 | 78 | foreach ($images as $image) { 79 | $uploader = new ImageUploader($image['url'], $image['alt'], $postarr); 80 | if ($uploadedImage = $uploader->save()) { 81 | $urlParts = parse_url($uploadedImage['url']); 82 | $base_url = $uploader::getHostUrl(null, true, true); 83 | $image_url = $base_url . $urlParts['path']; 84 | $content = preg_replace('/'. preg_quote($image['url'], '/') .'/', $image_url, $content); 85 | $content = preg_replace('/alt=["\']'. preg_quote($image['alt'], '/') .'["\']/', "alt='{$uploader->getAlt()}'", $content); 86 | } 87 | } 88 | return $content; 89 | } 90 | 91 | /** 92 | * Find image urls in content and retrieve urls by array 93 | * @param $content 94 | * @return array 95 | */ 96 | public function findAllImageUrls($content) 97 | { 98 | $urls1 = array(); 99 | preg_match_all('/]*srcset=["\']([^"\']*)[^"\']*["\'][^>]*>/i', $content, $srcsets, PREG_SET_ORDER); 100 | if (count($srcsets) > 0) { 101 | $count = 0; 102 | foreach ($srcsets as $key => $srcset) { 103 | preg_match_all('/(https?:)?\/\/[^\s,]+/i', $srcset[1], $srcsetUrls, PREG_SET_ORDER); 104 | if (count($srcsetUrls) == 0) { 105 | continue; 106 | } 107 | foreach ($srcsetUrls as $srcsetUrl) { 108 | $urls1[$count][] = $srcset[0]; 109 | $urls1[$count][] = $srcsetUrl[0]; 110 | $count++; 111 | } 112 | } 113 | } 114 | 115 | preg_match_all('/]*src=["\']([^"\']*)[^"\']*["\'][^>]*>/i', $content, $urls, PREG_SET_ORDER); 116 | $urls = array_merge($urls, $urls1); 117 | 118 | if (count($urls) == 0) { 119 | return array(); 120 | } 121 | foreach ($urls as $index => &$url) { 122 | $images[$index]['alt'] = preg_match('/]*alt=["\']([^"\']*)[^"\']*["\'][^>]*>/i', $url[0], $alt) ? $alt[1] : null; 123 | $images[$index]['url'] = $url = $url[1]; 124 | } 125 | foreach (array_unique($urls) as $index => $url) { 126 | $unique_array[] = $images[$index]; 127 | } 128 | return $unique_array; 129 | } 130 | 131 | /** 132 | * Add settings page under options menu 133 | */ 134 | public function addAdminMenu() 135 | { 136 | add_options_page( 137 | __('Auto Upload Images Settings', 'auto-upload-images'), 138 | __('Auto Upload Images', 'auto-upload-images'), 139 | 'manage_options', 140 | 'auto-upload', 141 | array($this, 'settingPage') 142 | ); 143 | } 144 | 145 | /** 146 | * Returns options in an array 147 | * @return array 148 | */ 149 | public static function getOptions() 150 | { 151 | if (static::$_options) { 152 | return static::$_options; 153 | } 154 | $defaults = array( 155 | 'base_url' => get_bloginfo('url'), 156 | 'image_name' => '%filename%', 157 | 'alt_name' => '%image_alt%', 158 | ); 159 | return static::$_options = wp_parse_args(get_option(self::WP_OPTIONS_KEY), $defaults); 160 | } 161 | 162 | /** 163 | * Reset options to default options 164 | * @return bool 165 | */ 166 | public static function resetOptionsToDefaults() 167 | { 168 | $defaults = array( 169 | 'base_url' => get_bloginfo('url'), 170 | 'image_name' => '%filename%', 171 | 'alt_name' => '%image_alt%', 172 | ); 173 | static::$_options = $defaults; 174 | return update_option(self::WP_OPTIONS_KEY, $defaults); 175 | } 176 | 177 | /** 178 | * Return an option with specific key 179 | * @param $key 180 | * @return mixed 181 | */ 182 | public static function getOption($key, $default = null) 183 | { 184 | $options = static::getOptions(); 185 | if (isset($options[$key]) === false) { 186 | return $default; 187 | } 188 | return $options[$key]; 189 | } 190 | 191 | /** 192 | * Returns fixed and replace deprecated patterns 193 | * @param $pattern 194 | * @return string 195 | */ 196 | public function replaceDeprecatedPatterns($pattern) 197 | { 198 | preg_match_all('/%(date|day)%/', $pattern, $rules); 199 | 200 | $patterns = array( 201 | '%date%' => '%today_date%', 202 | '%day%' => '%today_day%', 203 | ); 204 | 205 | if ($rules[0]) { 206 | foreach ($rules[0] as $rule) { 207 | $pattern = preg_replace("/$rule/", array_key_exists($rule, $patterns) ? $patterns[$rule] : $rule, $pattern); 208 | } 209 | } 210 | 211 | return $pattern; 212 | } 213 | 214 | /** 215 | * Settings page contents 216 | */ 217 | public function settingPage() 218 | { 219 | if (isset($_POST['submit']) && check_admin_referer('aui_settings')) { 220 | $textFields = array('base_url', 'image_name', 'alt_name', 'max_width', 'max_height'); 221 | foreach ($textFields as $field) { 222 | if (array_key_exists($field, $_POST) && $_POST[$field]) { 223 | if ($field === 'image_name' || $field === 'alt_name') { 224 | $_POST[$field] = $this->replaceDeprecatedPatterns($_POST[$field]); 225 | } 226 | 227 | static::$_options[$field] = sanitize_text_field($_POST[$field]); 228 | } 229 | } 230 | if (array_key_exists('exclude_urls', $_POST) && $_POST['exclude_urls']) { 231 | static::$_options['exclude_urls'] = sanitize_textarea_field($_POST['exclude_urls']); 232 | } 233 | if (array_key_exists('exclude_post_types', $_POST) && $_POST['exclude_post_types']) { 234 | foreach ($_POST['exclude_post_types'] as $typ) { 235 | static::$_options['exclude_post_types'][] = sanitize_text_field($typ); 236 | } 237 | } 238 | update_option(self::WP_OPTIONS_KEY, static::$_options); 239 | $message = __('Settings Saved.', 'auto-upload-images'); 240 | } 241 | 242 | if (isset($_POST['reset']) && self::resetOptionsToDefaults()) { 243 | $message = __('Successfully settings reset to defaults.', 'auto-upload-images'); 244 | } 245 | 246 | include_once('setting-page.php'); 247 | } 248 | } 249 | -------------------------------------------------------------------------------- /src/functions.php: -------------------------------------------------------------------------------- 1 | \n" 8 | "Language: de\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: D:/wamp/www/wp3\n" 14 | "X-Generator: Poedit 2.3\n" 15 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 17 | 18 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 19 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 20 | msgid "Auto Upload Images Settings" 21 | msgstr "Einstellungen Automatischer Bilderupload" 22 | 23 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 24 | msgid "Auto Upload Images" 25 | msgstr "Automatischer Bilderupload" 26 | 27 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 28 | msgid "Settings Saved." 29 | msgstr "Einstellungen gespeichert." 30 | 31 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 32 | msgid "Successfully settings reset to defaults." 33 | msgstr "" 34 | 35 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 36 | msgid "Base URL:" 37 | msgstr "Basis URL:" 38 | 39 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 40 | msgid "" 41 | "If you need to choose a new base URL for the images that will be " 42 | "automatically uploaded. Ex:" 43 | msgstr "" 44 | "Wenn du eine eigene Basis-URL für automatisch hochgeladene Bilder benutzen " 45 | "möchtest, gebe diese hier ein. Zum Beispiel:" 46 | 47 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 48 | msgid "Image Name:" 49 | msgstr "Bennenung:" 50 | 51 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 52 | #, php-format 53 | msgid "" 54 | "Choose a custom filename for the new images will be uploaded. You can also " 55 | "use these shortcodes %s." 56 | msgstr "" 57 | 58 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 59 | msgid "Alt Name:" 60 | msgstr "" 61 | 62 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 63 | #, php-format 64 | msgid "" 65 | "Choose a custom alt name for the new images will be uploaded. You can also " 66 | "use these shortcodes %s." 67 | msgstr "" 68 | 69 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 70 | msgid "Image Size:" 71 | msgstr "" 72 | 73 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 74 | msgid "(Inactive)" 75 | msgstr "" 76 | 77 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 78 | msgid "Max Width" 79 | msgstr "" 80 | 81 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 82 | msgid "Max Height" 83 | msgstr "" 84 | 85 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 86 | msgid "" 87 | "You can choose max width and height for images uploaded by this plugin on " 88 | "your site. If you leave empty each one of fields by default use the original " 89 | "size of the image." 90 | msgstr "" 91 | 92 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 93 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 94 | msgstr "" 95 | 96 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 97 | msgid "Exclude Post Types:" 98 | msgstr "" 99 | 100 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 101 | msgid "Select the Post Types that you want exclude from automatic uploading" 102 | msgstr "" 103 | 104 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 105 | msgid "Exclude Domains:" 106 | msgstr "Ausgeschlossene Domains:" 107 | 108 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 109 | msgid "" 110 | "Enter the domains you wish to be excluded from uploading images: (One domain " 111 | "per line)" 112 | msgstr "" 113 | "Hier kannst du Domains eingeben, die beim automatischen Download nicht " 114 | "berücksichtigt werden: (Eine Domain pro Zeile)" 115 | 116 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 117 | msgid "Reset Options" 118 | msgstr "" 119 | 120 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 121 | msgid "Are you sure to reset all options to defaults?" 122 | msgstr "" 123 | 124 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 125 | msgid "Information" 126 | msgstr "" 127 | 128 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 129 | msgid "Support and Donate to the Plugin" 130 | msgstr "" 131 | 132 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 133 | msgid "Report Bug and Issues" 134 | msgstr "" 135 | 136 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 137 | msgid "Github Repository" 138 | msgstr "" 139 | 140 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 141 | msgid "Plugin Page in WP" 142 | msgstr "" 143 | 144 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 145 | msgid "Rate to this plugin" 146 | msgstr "" 147 | 148 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 149 | msgid "Official Page" 150 | msgstr "" 151 | 152 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 153 | msgid "" 154 | "If you want to help to plugin development and if you can do so please make a " 155 | "donation to the project and encourage others to do so, for more updates and " 156 | "more features." 157 | msgstr "" 158 | 159 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 160 | msgid "Make a Donation" 161 | msgstr "" 162 | 163 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 164 | msgid "" 165 | "If you are a wp developer and like to contribute to this plugin development " 166 | "or you are a translator and want to have this plugin in your language you " 167 | "can start from plugin Github repository." 169 | msgstr "" 170 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-es.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-es.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-es.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images v1.5\n" 4 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 5 | "PO-Revision-Date: 2021-10-10 21:39+0330\n" 6 | "Last-Translator: Diego Herrera \n" 7 | "Language-Team: ECM \n" 8 | "Language: es\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=utf-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: D:/wamp/www/wp3\n" 14 | "X-Generator: Poedit 2.3\n" 15 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 16 | 17 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 18 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 19 | msgid "Auto Upload Images Settings" 20 | msgstr "Opciones de Subida de Imágenes Automática" 21 | 22 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 23 | msgid "Auto Upload Images" 24 | msgstr "Subir imágenes Automaticamente" 25 | 26 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 27 | msgid "Settings Saved." 28 | msgstr "Opciones guardadas." 29 | 30 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 31 | msgid "Successfully settings reset to defaults." 32 | msgstr "" 33 | 34 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 35 | msgid "Base URL:" 36 | msgstr "URL Base:" 37 | 38 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 39 | msgid "" 40 | "If you need to choose a new base URL for the images that will be " 41 | "automatically uploaded. Ex:" 42 | msgstr "" 43 | "Si necesitas escoger una nueva URL base para las imágenes que van a ser " 44 | "subidas automaticamente. Por ej." 45 | 46 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 47 | msgid "Image Name:" 48 | msgstr "Nombre de la Imágen" 49 | 50 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 51 | #, php-format 52 | msgid "" 53 | "Choose a custom filename for the new images will be uploaded. You can also " 54 | "use these shortcodes %s." 55 | msgstr "" 56 | 57 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 58 | msgid "Alt Name:" 59 | msgstr "" 60 | 61 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 62 | #, php-format 63 | msgid "" 64 | "Choose a custom alt name for the new images will be uploaded. You can also " 65 | "use these shortcodes %s." 66 | msgstr "" 67 | 68 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 69 | msgid "Image Size:" 70 | msgstr "" 71 | 72 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 73 | msgid "(Inactive)" 74 | msgstr "" 75 | 76 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 77 | msgid "Max Width" 78 | msgstr "" 79 | 80 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 81 | msgid "Max Height" 82 | msgstr "" 83 | 84 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 85 | msgid "" 86 | "You can choose max width and height for images uploaded by this plugin on " 87 | "your site. If you leave empty each one of fields by default use the original " 88 | "size of the image." 89 | msgstr "" 90 | 91 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 92 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 93 | msgstr "" 94 | 95 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 96 | msgid "Exclude Post Types:" 97 | msgstr "" 98 | 99 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 100 | msgid "Select the Post Types that you want exclude from automatic uploading" 101 | msgstr "" 102 | 103 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 104 | msgid "Exclude Domains:" 105 | msgstr "Exclusion de nombre de dominio" 106 | 107 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 108 | msgid "" 109 | "Enter the domains you wish to be excluded from uploading images: (One domain " 110 | "per line)" 111 | msgstr "" 112 | "Introduce los nombres de dominio que deseas excluir al subir imágenes: (Un " 113 | "nombre de dominio por línea)" 114 | 115 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 116 | msgid "Reset Options" 117 | msgstr "" 118 | 119 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 120 | msgid "Are you sure to reset all options to defaults?" 121 | msgstr "" 122 | 123 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 124 | msgid "Information" 125 | msgstr "" 126 | 127 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 128 | msgid "Support and Donate to the Plugin" 129 | msgstr "" 130 | 131 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 132 | msgid "Report Bug and Issues" 133 | msgstr "" 134 | 135 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 136 | msgid "Github Repository" 137 | msgstr "" 138 | 139 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 140 | msgid "Plugin Page in WP" 141 | msgstr "" 142 | 143 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 144 | msgid "Rate to this plugin" 145 | msgstr "" 146 | 147 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 148 | msgid "Official Page" 149 | msgstr "" 150 | 151 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 152 | msgid "" 153 | "If you want to help to plugin development and if you can do so please make a " 154 | "donation to the project and encourage others to do so, for more updates and " 155 | "more features." 156 | msgstr "" 157 | 158 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 159 | msgid "Make a Donation" 160 | msgstr "" 161 | 162 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 163 | msgid "" 164 | "If you are a wp developer and like to contribute to this plugin development " 165 | "or you are a translator and want to have this plugin in your language you " 166 | "can start from plugin Github repository." 168 | msgstr "" 169 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-fa_IR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-fa_IR.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-fa_IR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images\n" 4 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 5 | "PO-Revision-Date: 2021-10-10 21:39+0330\n" 6 | "Last-Translator: Ali Irani \n" 7 | "Language-Team: Ali Irani \n" 8 | "Language: fa_IR\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Generator: Poedit 2.3\n" 15 | 16 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 17 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 18 | msgid "Auto Upload Images Settings" 19 | msgstr "تنظیمات بارگذاری خودکار تصاویر" 20 | 21 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 22 | msgid "Auto Upload Images" 23 | msgstr "بارگذاری خودکار تصاویر" 24 | 25 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 26 | msgid "Settings Saved." 27 | msgstr "تنظیمات ذخیره شد." 28 | 29 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 30 | msgid "Successfully settings reset to defaults." 31 | msgstr "تنظیمات با موفقیت به حالت پیش‌فرض تغییر یافت." 32 | 33 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 34 | msgid "Base URL:" 35 | msgstr "آدرس اصلی:" 36 | 37 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 38 | msgid "" 39 | "If you need to choose a new base URL for the images that will be automatically " 40 | "uploaded. Ex:" 41 | msgstr "" 42 | "در صورت نیاز آدرس اصلی جدیدی برای تصاویری که به صورت خودکار بارگذاری می‌شوند " 43 | "انتخاب کنید. مثل:" 44 | 45 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 46 | msgid "Image Name:" 47 | msgstr "نام تصویر:" 48 | 49 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 50 | #, php-format 51 | msgid "" 52 | "Choose a custom filename for the new images will be uploaded. You can also use " 53 | "these shortcodes %s." 54 | msgstr "" 55 | "نام دلخواهی برای نام فایل تصاویر جدیدی که بارگذاری می‌شود انتخاب کنید. همچنین " 56 | "می‌توانید از کدهای کوتاه %s در این نام استفاده کنید." 57 | 58 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 59 | msgid "Alt Name:" 60 | msgstr "نام alt تصویر:" 61 | 62 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 63 | #, php-format 64 | msgid "" 65 | "Choose a custom alt name for the new images will be uploaded. You can also use " 66 | "these shortcodes %s." 67 | msgstr "" 68 | "نام دلخواهی برای نام alt تصاویر جدیدی که بارگذاری می‌شود انتخاب کنید. همچنین " 69 | "می‌توانید از کدهای کوتاه %s در این نام استفاده کنید." 70 | 71 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 72 | msgid "Image Size:" 73 | msgstr "اندازه تصویر:" 74 | 75 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 76 | msgid "(Inactive)" 77 | msgstr "(غیرفعال)" 78 | 79 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 80 | msgid "Max Width" 81 | msgstr "بیشترین عرض" 82 | 83 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 84 | msgid "Max Height" 85 | msgstr "بیشترین ارتفاع" 86 | 87 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 88 | msgid "" 89 | "You can choose max width and height for images uploaded by this plugin on your " 90 | "site. If you leave empty each one of fields by default use the original size of " 91 | "the image." 92 | msgstr "" 93 | "شما می‌توانید بیشترین عرض و ارتفاع تصاویری که با استفاده از این افزونه در سایت " 94 | "بارگذاری می‌شوند را از این قسمت تعیین نمایید. همچنین در صورت خالی رها کردن هر یک " 95 | "از این گزینه‌ها به صورت پیش‌فرض از اندازه های اصلی تصویر استفاده می‌گردد." 96 | 97 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 98 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 99 | msgstr "" 100 | "برای فعال سازی این امکان لطفا افزونه های Gd یا Imagick را برای PHP نصب و فعال " 101 | "نمائید." 102 | 103 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 104 | msgid "Exclude Post Types:" 105 | msgstr "نوع مطلب های مثتثنی:" 106 | 107 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 108 | msgid "Select the Post Types that you want exclude from automatic uploading" 109 | msgstr "" 110 | "نوع مطالبی که می‌خواهید بارگذاری خودکار تصاویر در آنها انجام نشود را انتخاب کنید." 111 | 112 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 113 | msgid "Exclude Domains:" 114 | msgstr "دامنه‌های مثتثنی:" 115 | 116 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 117 | msgid "" 118 | "Enter the domains you wish to be excluded from uploading images: (One domain " 119 | "per line)" 120 | msgstr "" 121 | "دامنه‌هایی را که می‌خواهید از آنها آپلود تصاویر انجام نگردد وارد نمایید: (هر خط " 122 | "یک آدرس)" 123 | 124 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 125 | msgid "Reset Options" 126 | msgstr "بازگردانی تنظیمات اصلی" 127 | 128 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 129 | msgid "Are you sure to reset all options to defaults?" 130 | msgstr "آیا از تغییر تمام تنظیمات این افزونه به حالت پیش‌فرض اطمینان دارید؟" 131 | 132 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 133 | msgid "Information" 134 | msgstr "اطلاعات" 135 | 136 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 137 | msgid "Support and Donate to the Plugin" 138 | msgstr "پشتیبانی و حمایت مالی از توسعه افزونه" 139 | 140 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 141 | msgid "Report Bug and Issues" 142 | msgstr "گزارش مشکل و درخواست بهبود" 143 | 144 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 145 | msgid "Github Repository" 146 | msgstr "مخزن گیت‌هاب" 147 | 148 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 149 | msgid "Plugin Page in WP" 150 | msgstr "صفحه افزونه در سایت وردپرس" 151 | 152 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 153 | msgid "Rate to this plugin" 154 | msgstr "به این افزونه امتیاز دهید" 155 | 156 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 157 | msgid "Official Page" 158 | msgstr "صفحه رسمی افزونه" 159 | 160 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 161 | msgid "" 162 | "If you want to help to plugin development and if you can do so please make a " 163 | "donation to the project and encourage others to do so, for more updates and " 164 | "more features." 165 | msgstr "" 166 | "اگر تمایل دارید تا از توسعه این افزونه پشتیبانی کنید و اگر این افزونه برای شما " 167 | "کاربردی است با حمایت مالی خود از این افزونه به ادامه توسعه و بهبود های آینده و " 168 | "اضافه شدن ویژگی های جدید به افزونه کمک کنید." 169 | 170 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 171 | msgid "Make a Donation" 172 | msgstr "حمایت مالی از توسعه افزونه" 173 | 174 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 175 | msgid "" 176 | "If you are a wp developer and like to contribute to this plugin development or " 177 | "you are a translator and want to have this plugin in your language you can " 178 | "start from plugin Github repository." 180 | msgstr "" 181 | "اگر شما یک توسعه‌دهنده وردپرس هستید و تمایل دارید تا در توسعه این افزونه مشارکت " 182 | "داشته باشید و یا یک مترجم هستید و می‌خواهید زبان مورد نظر خود را به افزونه اضافه " 183 | "کنید همین حالا می‌توانید از مخزن افزونه در گیت‌هاب شروع کنید." 185 | 186 | #~ msgid "Twitter of Plugin Developer" 187 | #~ msgstr "توییتر توسعه‌دهنده افزونه" 188 | 189 | #~ msgid "" 190 | #~ "\"PHP CURL\" not enabled on your site! For working with \"Auto Upload Images" 191 | #~ "\" plugin, you need to enable \"PHP CURL\", please contact with server admin " 192 | #~ "and send request to enable \"PHP CURL\" on your site." 193 | #~ msgstr "" 194 | #~ "\"PHP CURL\" در سایت شما غیرفعال است! برای آنکه افزونه «آپلود خودکار تصاویر» " 195 | #~ "به خوبی کار کند نیاز است تا \"PHP CURL\" را در سایت خود فعال کنید. به همین " 196 | #~ "منظور می‌توانید با مدیر سرور خود تماس گرفته و برای فعال شدن \"PHP CURL\" " 197 | #~ "درخواستی ارسال بفرمائید." 198 | 199 | #~ msgid "Developer at Twitter" 200 | #~ msgstr "حساب توییتر توسعه دهنده" 201 | 202 | #, fuzzy 203 | #~ msgid "" 204 | #~ "Choose a custom filename for the new images will be uploaded. You can also " 205 | #~ "use these shortcodes %filename%, " 206 | #~ "%url%, %date%, %year%, %month%, %day%, " 208 | #~ "%random%, %timestamp%, " 209 | #~ "%postname%, %post_id%." 210 | #~ msgstr "" 211 | #~ "نام دلخواهی برای نام فایل تصاویر جدیدی که بارگذاری می‌شود انتخاب کنید. همچنین " 212 | #~ "می‌توانید از کدهای کوتاه %filename%, %url%, %date% , %year%, %month%, %day% در " 215 | #~ "این نام استفاده کنید." 216 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-fr_FR.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-fr_FR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 6 | "PO-Revision-Date: 2021-10-10 21:40+0330\n" 7 | "Last-Translator: admin \n" 8 | "Language-Team: Français\n" 9 | "Language: fr_FR\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "X-Poedit-Basepath: /home/ali/www/wp\n" 15 | "X-Generator: Poedit 2.3\n" 16 | "Plural-Forms: nplurals=2; plural=n > 1;\n" 17 | "X-Loco-Version: 2.2.0; wp-5.0.3\n" 18 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 19 | 20 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 21 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 22 | msgid "Auto Upload Images Settings" 23 | msgstr "Réglages du rapatriement des images" 24 | 25 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 26 | msgid "Auto Upload Images" 27 | msgstr "Rapatrier les images" 28 | 29 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 30 | msgid "Settings Saved." 31 | msgstr "Réglages sauvegardés." 32 | 33 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 34 | msgid "Successfully settings reset to defaults." 35 | msgstr "" 36 | 37 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 38 | msgid "Base URL:" 39 | msgstr "URL de base :" 40 | 41 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 42 | msgid "" 43 | "If you need to choose a new base URL for the images that will be " 44 | "automatically uploaded. Ex:" 45 | msgstr "" 46 | "Si vous voulez choisir une URL de base différente pour les images " 47 | "rapatriées. Ex :" 48 | 49 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 50 | msgid "Image Name:" 51 | msgstr "Nom de l'image :" 52 | 53 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 54 | #, php-format 55 | msgid "" 56 | "Choose a custom filename for the new images will be uploaded. You can also " 57 | "use these shortcodes %s." 58 | msgstr "" 59 | "Personnalisez le nom de fichier des images rapatriées. Vous pouvez utiliser " 60 | "les shortcodes %s." 61 | 62 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 63 | msgid "Alt Name:" 64 | msgstr "Balise alt :" 65 | 66 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 67 | #, php-format 68 | msgid "" 69 | "Choose a custom alt name for the new images will be uploaded. You can also " 70 | "use these shortcodes %s." 71 | msgstr "" 72 | "Personnalisez la balise alt des images rapatriées. Vous pouvez utiliser les " 73 | "shortcodes %s." 74 | 75 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 76 | msgid "Image Size:" 77 | msgstr "Taille de l'image :" 78 | 79 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 80 | msgid "(Inactive)" 81 | msgstr "" 82 | 83 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 84 | msgid "Max Width" 85 | msgstr "Largeur maximale" 86 | 87 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 88 | msgid "Max Height" 89 | msgstr "Hauteur maximale" 90 | 91 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 92 | msgid "" 93 | "You can choose max width and height for images uploaded by this plugin on " 94 | "your site. If you leave empty each one of fields by default use the original " 95 | "size of the image." 96 | msgstr "" 97 | "Vous pouvez régler une hauteur et une largeur maximale pour les images " 98 | "rapatriées. Si vous laissez ces champs vides, le plugin utilisera la taille " 99 | "originelle de l'image." 100 | 101 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 102 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 103 | msgstr "" 104 | 105 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 106 | msgid "Exclude Post Types:" 107 | msgstr "Exclure ces types de Posts:" 108 | 109 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 110 | msgid "Select the Post Types that you want exclude from automatic uploading" 111 | msgstr "" 112 | "Sélectionnez les types de Posts que vous voulez exclure du rapatriement" 113 | 114 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 115 | msgid "Exclude Domains:" 116 | msgstr "Exclure les domaines :" 117 | 118 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 119 | msgid "" 120 | "Enter the domains you wish to be excluded from uploading images: (One domain " 121 | "per line)" 122 | msgstr "" 123 | "Vous pouvez interdire le rapatriement des images de ces domaines : (un " 124 | "domaine par ligne)" 125 | 126 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 127 | msgid "Reset Options" 128 | msgstr "" 129 | 130 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 131 | msgid "Are you sure to reset all options to defaults?" 132 | msgstr "" 133 | 134 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 135 | msgid "Information" 136 | msgstr "Information" 137 | 138 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 139 | msgid "Support and Donate to the Plugin" 140 | msgstr "" 141 | 142 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 143 | msgid "Report Bug and Issues" 144 | msgstr "Signaler un problème" 145 | 146 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 147 | msgid "Github Repository" 148 | msgstr "Dépôt Github" 149 | 150 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 151 | msgid "Plugin Page in WP" 152 | msgstr "Page du plugin sur WordPress" 153 | 154 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 155 | msgid "Rate to this plugin" 156 | msgstr "Noter ce plugin" 157 | 158 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 159 | msgid "Official Page" 160 | msgstr "Page officielle" 161 | 162 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 163 | msgid "" 164 | "If you want to help to plugin development and if you can do so please make a " 165 | "donation to the project and encourage others to do so, for more updates and " 166 | "more features." 167 | msgstr "" 168 | 169 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 170 | msgid "Make a Donation" 171 | msgstr "" 172 | 173 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 174 | msgid "" 175 | "If you are a wp developer and like to contribute to this plugin development " 176 | "or you are a translator and want to have this plugin in your language you " 177 | "can start from plugin Github repository." 179 | msgstr "" 180 | "Si vous êtes développeur et que vous souhaitez contribuer à l'amélioration " 181 | "du plugin, ou que vous voulez traduire ce plugin dans votre langue, vous " 182 | "pouvez démarrer sur le dépot de ce plugin sur Github." 184 | 185 | #~ msgid "Twitter of Plugin Developer" 186 | #~ msgstr "Twitter du développeur de ce plugin" 187 | 188 | #~ msgid "" 189 | #~ "\"PHP CURL\" not enabled on your site! For working with \"Auto Upload " 190 | #~ "Images\" plugin, you need to enable \"PHP CURL\", please contact with " 191 | #~ "server admin and send request to enable \"PHP CURL\" on your site." 192 | #~ msgstr "" 193 | #~ "\"CURL\" n'est pas installé sur votre hébergement. Pour le bon " 194 | #~ "fonctionnement du plugin \"Rapatrier les images\", vous devez l'activer. " 195 | #~ "Contactez votre administrateur ou votre hébergeur." 196 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-it_IT.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-it_IT.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images\n" 4 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 5 | "PO-Revision-Date: 2021-10-10 21:40+0330\n" 6 | "Last-Translator: Ali Irani \n" 7 | "Language-Team: P30Design \n" 8 | "Language: it_IT\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: /home/ali/www/wp\n" 14 | "X-Generator: Poedit 2.3\n" 15 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 17 | 18 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 19 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 20 | msgid "Auto Upload Images Settings" 21 | msgstr "Auto Upload Images Impostazioni" 22 | 23 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 24 | msgid "Auto Upload Images" 25 | msgstr "Auto Upload Images" 26 | 27 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 28 | msgid "Settings Saved." 29 | msgstr "Impostazioni Salvate" 30 | 31 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 32 | msgid "Successfully settings reset to defaults." 33 | msgstr "" 34 | 35 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 36 | msgid "Base URL:" 37 | msgstr "URL di base" 38 | 39 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 40 | msgid "" 41 | "If you need to choose a new base URL for the images that will be " 42 | "automatically uploaded. Ex:" 43 | msgstr "" 44 | "Se può scegliere un nuovo URL di base per le immagini che verranno caricate " 45 | "automaticamente. Es:" 46 | 47 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 48 | msgid "Image Name:" 49 | msgstr "Nome immagine" 50 | 51 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 52 | #, php-format 53 | msgid "" 54 | "Choose a custom filename for the new images will be uploaded. You can also " 55 | "use these shortcodes %s." 56 | msgstr "" 57 | 58 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 59 | msgid "Alt Name:" 60 | msgstr "" 61 | 62 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 63 | #, php-format 64 | msgid "" 65 | "Choose a custom alt name for the new images will be uploaded. You can also " 66 | "use these shortcodes %s." 67 | msgstr "" 68 | 69 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 70 | msgid "Image Size:" 71 | msgstr "Dimensione delle immagini:" 72 | 73 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 74 | msgid "(Inactive)" 75 | msgstr "" 76 | 77 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 78 | msgid "Max Width" 79 | msgstr "Larghezza massima" 80 | 81 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 82 | msgid "Max Height" 83 | msgstr "Altezza massima:" 84 | 85 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 86 | msgid "" 87 | "You can choose max width and height for images uploaded by this plugin on " 88 | "your site. If you leave empty each one of fields by default use the original " 89 | "size of the image." 90 | msgstr "" 91 | "Puoi scegliere una larghezza e un'altezza massima per le immagini che " 92 | "verranno caricate con questo plugin sul tuo sito. Se lascerai entrambi i " 93 | "campi vuoti l'immagine verrà caricata con dimensioni originali" 94 | 95 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 96 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 97 | msgstr "" 98 | 99 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 100 | msgid "Exclude Post Types:" 101 | msgstr "" 102 | 103 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 104 | msgid "Select the Post Types that you want exclude from automatic uploading" 105 | msgstr "" 106 | 107 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 108 | msgid "Exclude Domains:" 109 | msgstr "Domini esclusi" 110 | 111 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 112 | msgid "" 113 | "Enter the domains you wish to be excluded from uploading images: (One domain " 114 | "per line)" 115 | msgstr "" 116 | "Inserisci i domini che si desidera escludere dal caricamento automatico (Un " 117 | "dominio per riga)" 118 | 119 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 120 | msgid "Reset Options" 121 | msgstr "" 122 | 123 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 124 | msgid "Are you sure to reset all options to defaults?" 125 | msgstr "" 126 | 127 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 128 | msgid "Information" 129 | msgstr "" 130 | 131 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 132 | msgid "Support and Donate to the Plugin" 133 | msgstr "" 134 | 135 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 136 | msgid "Report Bug and Issues" 137 | msgstr "" 138 | 139 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 140 | msgid "Github Repository" 141 | msgstr "" 142 | 143 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 144 | msgid "Plugin Page in WP" 145 | msgstr "" 146 | 147 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 148 | msgid "Rate to this plugin" 149 | msgstr "" 150 | 151 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 152 | msgid "Official Page" 153 | msgstr "" 154 | 155 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 156 | msgid "" 157 | "If you want to help to plugin development and if you can do so please make a " 158 | "donation to the project and encourage others to do so, for more updates and " 159 | "more features." 160 | msgstr "" 161 | 162 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 163 | msgid "Make a Donation" 164 | msgstr "" 165 | 166 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 167 | msgid "" 168 | "If you are a wp developer and like to contribute to this plugin development " 169 | "or you are a translator and want to have this plugin in your language you " 170 | "can start from plugin Github repository." 172 | msgstr "" 173 | 174 | #~ msgid "" 175 | #~ "\"PHP CURL\" not enabled on your site! For working with \"Auto Upload " 176 | #~ "Images\" plugin, you need to enable \"PHP CURL\", please contact with " 177 | #~ "server admin and send request to enable \"PHP CURL\" on your site." 178 | #~ msgstr "" 179 | #~ "\"PHP CURL\" non è attivo sul tuo sito \"Auto Upload Images\" per " 180 | #~ "lavorare necessita l'attivazione di \"PHP CURL\", si prega di contattare " 181 | #~ "l'amministratore del server ed richiedere l'attivazione \"PHP CURL\" sul " 182 | #~ "tuo sito." 183 | 184 | #~ msgid "" 185 | #~ "Choose a custom filename for the new images will be uploaded. You can " 186 | #~ "also use these shortcodes %filename%, %url%, %date%, " 188 | #~ "%year%, %month%, %day%." 190 | #~ msgstr "" 191 | #~ "Scegli un nome personalizzato per le immagini che verranno caricate " 192 | #~ "automaticamente. Puoi usare i seguenti Shortcode " 193 | #~ "%filename%, %url%, %date" 194 | #~ "%, %year%, %month%, %day%." 196 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-ko_KR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-ko_KR.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-ko_KR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images\n" 4 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 5 | "PO-Revision-Date: 2021-10-10 21:40+0330\n" 6 | "Last-Translator: \n" 7 | "Language-Team: P30Design \n" 8 | "Language: ko_KR\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: /home/ali/www/wp\n" 14 | "X-Generator: Poedit 2.3\n" 15 | "Plural-Forms: nplurals=1; plural=0;\n" 16 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 17 | 18 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 19 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 20 | msgid "Auto Upload Images Settings" 21 | msgstr "자동 업로드 이미지 설정" 22 | 23 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 24 | msgid "Auto Upload Images" 25 | msgstr "자동 업로드 이미지" 26 | 27 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 28 | msgid "Settings Saved." 29 | msgstr "설정 저장됨." 30 | 31 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 32 | msgid "Successfully settings reset to defaults." 33 | msgstr "" 34 | 35 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 36 | msgid "Base URL:" 37 | msgstr "기본 URL:" 38 | 39 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 40 | msgid "" 41 | "If you need to choose a new base URL for the images that will be " 42 | "automatically uploaded. Ex:" 43 | msgstr "자동으로 업로드할 영상에 대해 새 기본 URL을 선택해야 하는 경우. Ex:" 44 | 45 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 46 | msgid "Image Name:" 47 | msgstr "이미지 명:" 48 | 49 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 50 | #, php-format 51 | msgid "" 52 | "Choose a custom filename for the new images will be uploaded. You can also " 53 | "use these shortcodes %s." 54 | msgstr "" 55 | "새 이미지를 업로드할 사용자 지정 파일 이름을 선택합니다. 이러한 단축 코드(%s)" 56 | "도 사용할 수 있습니다." 57 | 58 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 59 | msgid "Alt Name:" 60 | msgstr "대체명:" 61 | 62 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 63 | #, php-format 64 | msgid "" 65 | "Choose a custom alt name for the new images will be uploaded. You can also " 66 | "use these shortcodes %s." 67 | msgstr "" 68 | "새 영상이 업로드될 사용자 지정 대체명을 선택합니다. 이러한 단축 코드(%s)도 사" 69 | "용할 수 있습니다." 70 | 71 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 72 | msgid "Image Size:" 73 | msgstr "이미지 크기:" 74 | 75 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 76 | msgid "(Inactive)" 77 | msgstr "" 78 | 79 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 80 | msgid "Max Width" 81 | msgstr "최고 넓이" 82 | 83 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 84 | msgid "Max Height" 85 | msgstr "최고 높이" 86 | 87 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 88 | msgid "" 89 | "You can choose max width and height for images uploaded by this plugin on " 90 | "your site. If you leave empty each one of fields by default use the original " 91 | "size of the image." 92 | msgstr "" 93 | "사이트에서 이 플러그 인으로 업로드한 이미지의 최대 너비와 높이를 선택할 수 있" 94 | "습니다. 기본적으로 각 필드를 비워 두는 경우 영상의 원래 크기를 사용하십시오." 95 | 96 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 97 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 98 | msgstr "" 99 | 100 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 101 | msgid "Exclude Post Types:" 102 | msgstr "게시 유형 제외:" 103 | 104 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 105 | msgid "Select the Post Types that you want exclude from automatic uploading" 106 | msgstr "자동 업로드에서 제외할 게시 유형 선택" 107 | 108 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 109 | msgid "Exclude Domains:" 110 | msgstr "도메인 제외:" 111 | 112 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 113 | msgid "" 114 | "Enter the domains you wish to be excluded from uploading images: (One domain " 115 | "per line)" 116 | msgstr "업로드에서 제외할 도메인 입력:(한줄에 하나의 도메인)" 117 | 118 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 119 | msgid "Reset Options" 120 | msgstr "" 121 | 122 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 123 | msgid "Are you sure to reset all options to defaults?" 124 | msgstr "" 125 | 126 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 127 | msgid "Information" 128 | msgstr "정보" 129 | 130 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 131 | msgid "Support and Donate to the Plugin" 132 | msgstr "" 133 | 134 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 135 | msgid "Report Bug and Issues" 136 | msgstr "버그 보고와 이슈" 137 | 138 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 139 | msgid "Github Repository" 140 | msgstr "Github 저장소" 141 | 142 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 143 | msgid "Plugin Page in WP" 144 | msgstr "WP의 플러그 인 페이지" 145 | 146 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 147 | msgid "Rate to this plugin" 148 | msgstr "이 플러그인 평가" 149 | 150 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 151 | msgid "Official Page" 152 | msgstr "공식 페이지" 153 | 154 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 155 | msgid "" 156 | "If you want to help to plugin development and if you can do so please make a " 157 | "donation to the project and encourage others to do so, for more updates and " 158 | "more features." 159 | msgstr "" 160 | 161 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 162 | msgid "Make a Donation" 163 | msgstr "" 164 | 165 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 166 | msgid "" 167 | "If you are a wp developer and like to contribute to this plugin development " 168 | "or you are a translator and want to have this plugin in your language you " 169 | "can start from plugin Github repository." 171 | msgstr "" 172 | "당신이 WP 개발자이고 이 플러그인 개발에 기여하고 싶거나 이 플러그 인을 변환기" 173 | "로 사용하고 싶은 경우 플러그인 Github 저장소 에서 시작 할 수 있습니다." 175 | 176 | #~ msgid "Twitter of Plugin Developer" 177 | #~ msgstr "플러그인 개발자 트윗" 178 | 179 | #~ msgid "" 180 | #~ "\"PHP CURL\" not enabled on your site! For working with \"Auto Upload " 181 | #~ "Images\" plugin, you need to enable \"PHP CURL\", please contact with " 182 | #~ "server admin and send request to enable \"PHP CURL\" on your site." 183 | #~ msgstr "" 184 | #~ "사용자의 사이트에서 \"PHPCURL\"이 활성화되지 않았습니다. \"AutoUploadImage" 185 | #~ "\"플러그 인을 사용하려면 \"PHPCURL\"을 사용하도록 설정해야 하며, 서버 관리" 186 | #~ "자에게 문의하여 사용자 사이트에서 \"PHPCURL\"을 사용하도록 설정하십시오." 187 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images-ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images-ru_RU.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images-ru_RU.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Auto Upload Images v1.5\n" 4 | "POT-Creation-Date: 2021-10-10 21:37+0330\n" 5 | "PO-Revision-Date: 2021-10-10 21:40+0330\n" 6 | "Last-Translator: Артём Рябков / Artur Vereych \n" 8 | "Language-Team: P30Design \n" 9 | "Language: ru_RU\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "X-Poedit-Basepath: D:/wamp/www/wp3\n" 15 | "X-Generator: Poedit 2.3\n" 16 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 17 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 18 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 19 | 20 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 21 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 22 | msgid "Auto Upload Images Settings" 23 | msgstr "Настройки Auto Upload Images" 24 | 25 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 26 | msgid "Auto Upload Images" 27 | msgstr "Auto Upload Images" 28 | 29 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 30 | msgid "Settings Saved." 31 | msgstr "Настройки Сохранены." 32 | 33 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 34 | msgid "Successfully settings reset to defaults." 35 | msgstr "Настройки по умолчанию успешно восстановлены." 36 | 37 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 38 | msgid "Base URL:" 39 | msgstr "Основной домен:" 40 | 41 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 42 | msgid "" 43 | "If you need to choose a new base URL for the images that will be " 44 | "automatically uploaded. Ex:" 45 | msgstr "Если вам нужен другой основной домен для загрузки изображения. Пример:" 46 | 47 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 48 | msgid "Image Name:" 49 | msgstr "Название Изображения:" 50 | 51 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 52 | #, php-format 53 | msgid "" 54 | "Choose a custom filename for the new images will be uploaded. You can also " 55 | "use these shortcodes %s." 56 | msgstr "" 57 | "Выберите пользовательское название для новых изображений, которые будут " 58 | "загружены.Вы также можете использовать эти шорткоды %s." 59 | 60 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 61 | msgid "Alt Name:" 62 | msgstr "Альтернативное название" 63 | 64 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 65 | #, php-format 66 | msgid "" 67 | "Choose a custom alt name for the new images will be uploaded. You can also " 68 | "use these shortcodes %s." 69 | msgstr "" 70 | "Выберите пользовательское альтернативное название для новых изображений, " 71 | "которые будут загружены.Вы также можете использовать эти шорткоды %s." 72 | 73 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 74 | msgid "Image Size:" 75 | msgstr "Размер изображений" 76 | 77 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 78 | msgid "(Inactive)" 79 | msgstr "(Неактивный)" 80 | 81 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 82 | msgid "Max Width" 83 | msgstr "Максимальная ширина" 84 | 85 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 86 | msgid "Max Height" 87 | msgstr "Максимальная высота" 88 | 89 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 90 | msgid "" 91 | "You can choose max width and height for images uploaded by this plugin on " 92 | "your site. If you leave empty each one of fields by default use the original " 93 | "size of the image." 94 | msgstr "" 95 | "Вы можете выбрать максимальную ширину и высоту для изображений, загружаемых " 96 | "этим плагином на ваш сайт. Если вы оставите пустым каждое из полей по " 97 | "умолчанию, загрузится оригинальный размер изображения." 98 | 99 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 100 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 101 | msgstr "" 102 | "Чтобы активировать эту функцию, пожалуйста, включите Gd или Imagick " 103 | "расширения PHP." 104 | 105 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 106 | msgid "Exclude Post Types:" 107 | msgstr "Исключить типы сообщений:" 108 | 109 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 110 | msgid "Select the Post Types that you want exclude from automatic uploading" 111 | msgstr "" 112 | "Выберите типы сообщений, которые вы хотите исключить из автоматической " 113 | "загрузки" 114 | 115 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 116 | msgid "Exclude Domains:" 117 | msgstr "Исключенные домены:" 118 | 119 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 120 | msgid "" 121 | "Enter the domains you wish to be excluded from uploading images: (One domain " 122 | "per line)" 123 | msgstr "" 124 | "Выберите домены с которых не нужно копировать изображения: (Один домен - " 125 | "одна строка)" 126 | 127 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 128 | msgid "Reset Options" 129 | msgstr "Сбросить параметры" 130 | 131 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 132 | msgid "Are you sure to reset all options to defaults?" 133 | msgstr "Вы уверены, что хотите сбросить все параметры?" 134 | 135 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 136 | msgid "Information" 137 | msgstr "Информация" 138 | 139 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 140 | msgid "Support and Donate to the Plugin" 141 | msgstr "" 142 | 143 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 144 | msgid "Report Bug and Issues" 145 | msgstr "Сообщить об ошибке" 146 | 147 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 148 | msgid "Github Repository" 149 | msgstr "Github репозиторий" 150 | 151 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 152 | msgid "Plugin Page in WP" 153 | msgstr "Страница плагина в WP" 154 | 155 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 156 | msgid "Rate to this plugin" 157 | msgstr "Оцените этот плагин" 158 | 159 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 160 | msgid "Official Page" 161 | msgstr "Официальная страница" 162 | 163 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 164 | msgid "" 165 | "If you want to help to plugin development and if you can do so please make a " 166 | "donation to the project and encourage others to do so, for more updates and " 167 | "more features." 168 | msgstr "" 169 | 170 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 171 | msgid "Make a Donation" 172 | msgstr "" 173 | 174 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 175 | msgid "" 176 | "If you are a wp developer and like to contribute to this plugin development " 177 | "or you are a translator and want to have this plugin in your language you " 178 | "can start from plugin Github repository." 180 | msgstr "" 181 | "Если вы разработчик wp и хотели бы внести свой вклад в разработку этого " 182 | "плагинаили вы переводчик и хотите, чтобы этот плагин на вашем языке выможно " 183 | "начать с Github репозитория плагина." 185 | 186 | #~ msgid "Twitter of Plugin Developer" 187 | #~ msgstr "Твиттер разработчика" 188 | -------------------------------------------------------------------------------- /src/lang/auto-upload-images.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/airani/wp-auto-upload/adc220b79758e744dd053e86a45e1e7962a3b789/src/lang/auto-upload-images.mo -------------------------------------------------------------------------------- /src/lang/auto-upload-images.pot: -------------------------------------------------------------------------------- 1 | #, fuzzy 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Auto Upload Images\n" 5 | "POT-Creation-Date: 2021-10-10 21:41+0330\n" 6 | "PO-Revision-Date: 2017-03-19 20:10+0330\n" 7 | "Last-Translator: Ali Irani \n" 8 | "Language-Team: Ali Irani \n" 9 | "Language: en\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "X-Poedit-Basepath: /home/ali/www/wp\n" 15 | "X-Generator: Poedit 2.3\n" 16 | "X-Poedit-SearchPath-0: wp-content/plugins/auto-upload-images\n" 17 | 18 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:137 19 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:4 20 | msgid "Auto Upload Images Settings" 21 | msgstr "" 22 | 23 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:138 24 | msgid "Auto Upload Images" 25 | msgstr "" 26 | 27 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:204 28 | msgid "Settings Saved." 29 | msgstr "" 30 | 31 | #: wp-content/plugins/auto-upload-images/src/WpAutoUpload.php:208 32 | msgid "Successfully settings reset to defaults." 33 | msgstr "" 34 | 35 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:21 36 | msgid "Base URL:" 37 | msgstr "" 38 | 39 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:26 40 | msgid "" 41 | "If you need to choose a new base URL for the images that will be " 42 | "automatically uploaded. Ex:" 43 | msgstr "" 44 | 45 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:32 46 | msgid "Image Name:" 47 | msgstr "" 48 | 49 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:38 50 | #, php-format 51 | msgid "" 52 | "Choose a custom filename for the new images will be uploaded. You can also " 53 | "use these shortcodes %s." 54 | msgstr "" 55 | 56 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:45 57 | msgid "Alt Name:" 58 | msgstr "" 59 | 60 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:51 61 | #, php-format 62 | msgid "" 63 | "Choose a custom alt name for the new images will be uploaded. You can also " 64 | "use these shortcodes %s." 65 | msgstr "" 66 | 67 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:59 68 | msgid "Image Size:" 69 | msgstr "" 70 | 71 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:61 72 | msgid "(Inactive)" 73 | msgstr "" 74 | 75 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:65 76 | msgid "Max Width" 77 | msgstr "" 78 | 79 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:67 80 | msgid "Max Height" 81 | msgstr "" 82 | 83 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:69 84 | msgid "" 85 | "You can choose max width and height for images uploaded by this plugin on " 86 | "your site. If you leave empty each one of fields by default use the original " 87 | "size of the image." 88 | msgstr "" 89 | 90 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:71 91 | msgid "To activate this feature please enable Gd or Imagick extensions of PHP." 92 | msgstr "" 93 | 94 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:79 95 | msgid "Exclude Post Types:" 96 | msgstr "" 97 | 98 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:92 99 | msgid "Select the Post Types that you want exclude from automatic uploading" 100 | msgstr "" 101 | 102 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:98 103 | msgid "Exclude Domains:" 104 | msgstr "" 105 | 106 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:102 107 | msgid "" 108 | "Enter the domains you wish to be excluded from uploading images: (One domain " 109 | "per line)" 110 | msgstr "" 111 | 112 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:109 113 | msgid "Reset Options" 114 | msgstr "" 115 | 116 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:110 117 | msgid "Are you sure to reset all options to defaults?" 118 | msgstr "" 119 | 120 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:118 121 | msgid "Information" 122 | msgstr "" 123 | 124 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:123 125 | msgid "Support and Donate to the Plugin" 126 | msgstr "" 127 | 128 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:126 129 | msgid "Report Bug and Issues" 130 | msgstr "" 131 | 132 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:129 133 | msgid "Github Repository" 134 | msgstr "" 135 | 136 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:132 137 | msgid "Plugin Page in WP" 138 | msgstr "" 139 | 140 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:136 141 | msgid "Rate to this plugin" 142 | msgstr "" 143 | 144 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:140 145 | msgid "Official Page" 146 | msgstr "" 147 | 148 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 149 | msgid "" 150 | "If you want to help to plugin development and if you can do so please make a " 151 | "donation to the project and encourage others to do so, for more updates and " 152 | "more features." 153 | msgstr "" 154 | 155 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:144 156 | msgid "Make a Donation" 157 | msgstr "" 158 | 159 | #: wp-content/plugins/auto-upload-images/src/setting-page.php:146 160 | msgid "" 161 | "If you are a wp developer and like to contribute to this plugin development " 162 | "or you are a translator and want to have this plugin in your language you " 163 | "can start from plugin Github repository." 165 | msgstr "" 166 | -------------------------------------------------------------------------------- /src/setting-page.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

5 | 6 | 7 |
8 |

9 |
10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 | 25 | 29 | 30 | 31 | 36 | 42 | 43 | 44 | 49 | 55 | 56 | 57 | 58 | > 59 | 65 | 75 | 76 | 77 | 78 | 83 | 95 | 96 | 97 | 102 | 106 | 107 |
21 | 24 | 26 | 27 |

https://irani.im, https://cdn.irani.im, /

28 |
32 | 35 | 37 | 38 |

39 | %filename%, %image_alt%, %url%, %today_date%, %year%, %month%, %today_day%, %post_date%, %post_year%, %post_month%, %post_day%, %random%, %timestamp%, %postname%, %post_id%') ?> 40 |

41 |
45 | 48 | 50 | 51 |

52 | %filename%, %image_alt%, %url%, %today_date%, %year%, %month%, %today_day%, %post_date%, %post_year%, %post_month%, %post_day%, %random%, %timestamp%, %postname%, %post_id%') ?> 53 |

54 |
60 | 61 | 62 | 63 | 64 | 66 | 67 | > 68 | 69 | > 70 |

71 | 72 |

73 | 74 |
79 | 82 | 84 |

85 | 86 | 87 | 91 | 92 |

93 |

94 |
98 | 101 | 103 |

104 |

105 |
108 |

109 | 110 | 'return confirm("'. __('Are you sure to reset all options to defaults?', 'auto-upload-images') .'");' 112 | )) ?> 113 |

114 |
115 |
116 |
117 |
118 |
119 |

120 |
121 |
122 |
    123 |
  • 124 | 125 |
  • 126 |
  • 127 | 128 |
  • 129 |
  • 130 | 131 |
  • 132 |
  • 133 | 134 |
  • 135 |
  • 136 | 137 | 138 | 139 |
  • 140 | 143 |
144 |
145 |

146 |
147 |

plugin Github repository.', 'auto-upload-images') ?>

148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 1, 16 | 'post_name' => 'sample', 17 | ); 18 | 19 | $this->imageUploader = new ImageUploader('https://irani.im/images/ali-irani.jpg', 'sample alt', $samplePost); 20 | } 21 | 22 | public function testGetHostUrl() 23 | { 24 | $host = ImageUploader::getHostUrl('https://www.irani.im/test'); 25 | $this->assertEquals('irani.im', $host); 26 | 27 | $host = ImageUploader::getHostUrl('https://www.irani.im/test', true); 28 | $this->assertEquals('https://irani.im', $host); 29 | } 30 | 31 | public function testValidate() 32 | { 33 | $this->imageUploader->url = 'https://irani.im/images/ali-irani.jpg'; 34 | $this->assertTrue($this->imageUploader->validate()); 35 | 36 | $this->imageUploader->url = 'https://example.org/sample.jpg'; 37 | $this->assertFalse($this->imageUploader->validate()); 38 | } 39 | 40 | public function testGetFilename() 41 | { 42 | $this->imageUploader->url = 'https://irani.im/images/ali-irani.jpg?a=b&d=c'; 43 | $result = $this->invokeMethod($this->imageUploader, 'getFilename'); 44 | $this->assertEquals('ali-irani', $result); 45 | 46 | $this->imageUploader->url = 'https://irani.im/images/get.php?file=ali.jpg'; 47 | $result = $this->invokeMethod($this->imageUploader, 'getFilename'); 48 | $this->assertStringMatchesFormat('img_%s', $result); 49 | } 50 | 51 | public function testGetOriginalFilename() 52 | { 53 | $this->imageUploader->url = 'https://irani.im/images/ali-irani.jpg'; 54 | $result = $this->invokeMethod($this->imageUploader, 'getOriginalFilename'); 55 | $this->assertEquals('ali-irani', $result); 56 | 57 | $this->imageUploader->url = 'https://irani.im/images/ali-irani.php'; 58 | $result = $this->invokeMethod($this->imageUploader, 'getOriginalFilename'); 59 | $this->assertNull($result); 60 | } 61 | 62 | public function testGetUploadDir() 63 | { 64 | $result = $this->invokeMethod($this->imageUploader, 'getUploadDir', array('url')); 65 | $this->assertStringMatchesFormat('http://example.org/wp-content/uploads/%d/%d', $result); 66 | 67 | $result = $this->invokeMethod($this->imageUploader, 'getUploadDir', array('path')); 68 | $this->assertStringMatchesFormat('%s%ewp-content%euploads%e%d%e%d', $result); 69 | } 70 | 71 | public function testGetAlt() 72 | { 73 | $this->assertEquals('sample alt', $this->imageUploader->getAlt()); 74 | } 75 | 76 | public function testResolvePattern() 77 | { 78 | $this->assertEquals('ali-irani', $this->imageUploader->resolvePattern('%filename%')); 79 | $this->assertEquals('sample alt', $this->imageUploader->resolvePattern('%image_alt%')); 80 | $this->assertEquals(date('Y-m-j'), $this->imageUploader->resolvePattern('%date%')); 81 | $this->assertEquals(date('Y'), $this->imageUploader->resolvePattern('%year%')); 82 | $this->assertEquals(date('m'), $this->imageUploader->resolvePattern('%month%')); 83 | $this->assertEquals(date('j'), $this->imageUploader->resolvePattern('%day%')); 84 | $this->assertStringMatchesFormat('%ali%', $this->imageUploader->resolvePattern('%ali%')); 85 | } 86 | 87 | /** 88 | * @dataProvider imageUrlsProvider 89 | */ 90 | public function testDownloadImageSuccessfully($url, $filenamePattern, $mime_type, $extension) 91 | { 92 | $this->imageUploader->url = $url; 93 | $result = $this->imageUploader->downloadImage($url); 94 | $this->assertTrue(is_array($result)); 95 | $this->assertArrayHasKey('url', $result); 96 | $this->assertStringMatchesFormat('http://example.org/wp-content/uploads/%d/%d/%s.%s', $result['url']); 97 | $this->assertStringMatchesFormat($filenamePattern, $result['filename']); 98 | $this->assertEquals($mime_type, $result['mime_type']); 99 | $this->assertEquals($extension, $result['ext']); 100 | } 101 | 102 | public function imageUrlsProvider() 103 | { 104 | return array( 105 | array('https://irani.im/images/ali-irani.jpg', 'ali-irani.jpg', 'image/jpeg', 'jpg'), 106 | array('https://d418bv7mr3wfv.cloudfront.net/s3/W1siZiIsIjIwMTgvMTAvMTEvMjMvMDIvNTUvMjQxL1dlIGFzayBxdWVzdGlvbnMgdGhhdCBjcmVhdGUgbWFnaWNhbCBjb25uZWN0aW9ucyAoNCkucG5nIl1d', 'img_%s.png', 'image/png', 'png'), 107 | array('https://www.geocaching.com/help/index.php?pg=file&from=2&id=760', 'img_%s.jpg', 'image/jpeg', 'jpg'), 108 | array('https://images.unsplash.com/photo-1511988617509-a57c8a288659?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjI1NDQxfQ&s=e91ec3d695b7e406f29dd80a706fc0ad&w=1000', 'img_%s.jpg', 'image/jpeg', 'jpg'), 109 | array('https://res.cloudinary.com/airani/image/upload/v1669669791/مادر-شهید_paixih.jpg', 'img_%s.jpg', 'image/jpeg', 'jpg') 110 | ); 111 | } 112 | 113 | public function testDownloadImageFailed() 114 | { 115 | $result = $this->imageUploader->downloadImage('https://irani.im/images/ali-irani.php'); 116 | $this->assertWPError($result); 117 | } 118 | 119 | public function testResizeImage() 120 | { 121 | if (!wp_image_editor_supports()) { 122 | $this->assertTrue(true); 123 | return; 124 | } 125 | 126 | $wpAutoUpload = new WpAutoUpload(); 127 | $_POST['submit'] = true; 128 | $_POST['max_width'] = 50; 129 | $_POST['max_height'] = 50; 130 | ob_start(); 131 | $wpAutoUpload->settingPage(); 132 | ob_end_clean(); 133 | $this->imageUploader->url = 'https://irani.im/images/ali-irani.jpg'; 134 | $result = $this->imageUploader->downloadImage('https://irani.im/images/ali-irani.jpg'); 135 | $this->assertTrue(is_array($result)); 136 | $this->assertStringMatchesFormat('%s-50x50.jpg', $result['path']); 137 | $this->assertStringMatchesFormat('%s-50x50.jpg', $result['url']); 138 | $this->assertFileExists($result['path']); 139 | 140 | $this->assertTrue(WpAutoUpload::resetOptionsToDefaults()); 141 | $this->assertNull(WpAutoUpload::getOption('max_width')); 142 | } 143 | 144 | /** 145 | * Call protected/private method of a class. 146 | * 147 | * @param object &$object Instantiated object that we will run method on. 148 | * @param string $methodName Method name to call 149 | * @param array $parameters Array of parameters to pass into method. 150 | * 151 | * @return mixed Method return. 152 | */ 153 | public function invokeMethod(&$object, $methodName, array $parameters = array()) 154 | { 155 | $reflection = new \ReflectionClass(get_class($object)); 156 | $method = $reflection->getMethod($methodName); 157 | $method->setAccessible(true); 158 | 159 | return $method->invokeArgs($object, $parameters); 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /tests/test-WpAutoUpload.php: -------------------------------------------------------------------------------- 1 | This is my picture.\n"; 8 | $content .= "another image like this "; 9 | $content .= "srcset test \"\""; 10 | $content .= "srcset2 test \"\""; 11 | 12 | $wp_aui = new WpAutoUpload(); 13 | $results = $wp_aui->findAllImageUrls($content); 14 | 15 | $this->assertTrue(is_array($results)); 16 | $this->assertEquals(12, count($results)); 17 | 18 | $results = $wp_aui->findAllImageUrls(''); 19 | $this->assertEquals(0, count($results)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/test-plugin-work.php: -------------------------------------------------------------------------------- 1 | '; 9 | 10 | $postID = $this->factory->post->create(array('post_content' => $content, 'post_name' => 'test')); 11 | 12 | $this->assertGreaterThan(0, $postID, 'Post creation failed.'); 13 | 14 | $post = $this->factory->post->get_object_by_id($postID); 15 | 16 | $this->assertInstanceOf('WP_Post', $post, 'Get created post failed.'); 17 | 18 | return $post; 19 | } 20 | 21 | /** 22 | * @depends testCreatePost 23 | */ 24 | public function testPluginWorks(WP_Post $post) 25 | { 26 | $this->assertStringMatchesFormat('%shttp://example.org/wp-content/uploads/%d/%d/%s.jpg%s', $post->post_content); 27 | } 28 | } 29 | --------------------------------------------------------------------------------