Plugin Directory

Changeset 1772686


Ignore:
Timestamp:
11/21/2017 11:08:23 PM (8 years ago)
Author:
SimonStone
Message:
Location:
pixabay-images/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • pixabay-images/trunk/langs/pixabay_images-de_DE.po

    r1717044 r1772686  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Pixabay Images WordPress Plugin\n"
    4 "POT-Creation-Date: 2014-06-03 15:00+0100\n"
    5 "PO-Revision-Date: 2014-06-04 09:20+0100\n"
    6 "Last-Translator: Simon Steinberger <simon@pixabay.com>\n"
    7 "Language-Team: \n"
    8 "Language: \n"
    93"MIME-Version: 1.0\n"
    104"Content-Type: text/plain; charset=UTF-8\n"
    115"Content-Transfer-Encoding: 8bit\n"
    12 "X-Poedit-KeywordsList: _e;__;esc_html_e;esc_attr_e;esc_html__;esc_attr__\n"
    136
    147msgid "Photos"
     
    3023msgstr "Suchen"
    3124
     25msgid "Search for \"red roses\", \"flowers -red\", \"city OR town\", etc."
     26msgstr "Suche nach \"rote rosen\", \"blumen -rot\", \"blau OR grün\", etc."
     27
    3228msgid "All"
    3329msgstr "Alle"
     30
     31msgid "Exclude inappropriate or explicit images"
     32msgstr "Nur jugendfreie Bilder anzeigen"
    3433
    3534msgid "Insert image credits"
  • pixabay-images/trunk/langs/pixabay_images-es_ES.po

    r1717044 r1772686  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Pixabay Images WordPress Plugin\n"
    4 "POT-Creation-Date: 2014-06-03 15:00+0100\n"
    5 "PO-Revision-Date: 2014-06-04 09:44+0100\n"
    6 "Last-Translator: Simon Steinberger <simon@pixabay.com>\n"
    7 "Language-Team: \n"
    8 "Language: \n"
    93"MIME-Version: 1.0\n"
    104"Content-Type: text/plain; charset=UTF-8\n"
    115"Content-Transfer-Encoding: 8bit\n"
    12 "X-Poedit-KeywordsList: _e;__;esc_html_e;esc_attr_e;esc_html__;esc_attr__\n"
    136
    147msgid "Photos"
     
    3023msgstr "Buscar"
    3124
     25msgid "Search for \"red roses\", \"flowers -red\", \"city OR town\", etc."
     26msgstr ""
     27
    3228msgid "All"
    3329msgstr "Todos"
     30
     31msgid "Exclude inappropriate or explicit images"
     32msgstr "Filtrar resultados explícitos"
    3433
    3534msgid "Insert image credits"
  • pixabay-images/trunk/langs/pixabay_images-sr_RS.po

    r1717044 r1772686  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Pixabay Images WordPress Plugin\n"
    43"MIME-Version: 1.0\n"
    54"Content-Type: text/plain; charset=UTF-8\n"
     
    2423msgstr "Traži"
    2524
     25msgid "Search for \"red roses\", \"flowers -red\", \"city OR town\", etc."
     26msgstr ""
     27
    2628msgid "All"
    2729msgstr "Svi"
     30
     31msgid "Exclude inappropriate or explicit images"
     32msgstr "Vylúčiť obmedzené obrázky"
    2833
    2934msgid "Insert image credits"
  • pixabay-images/trunk/pixabay-images.php

    r1717044 r1772686  
    33/*
    44Plugin Name: Pixabay Images
    5 Plugin URI: https://pixabay.com/blog/posts/p-36/
     5Plugin URI: https://pixabay.com/blog/posts/p-136/
    66Description: Find quality public domain images from Pixabay and upload them with just one click.
    7 Version: 3.0
     7Version: 3.1
    88Author: Simon Steinberger
    99Author URI: https://pixabay.com/users/Simon/
     
    100100            var post_id = <?=absint($_REQUEST['post_id']) ?>,
    101101                lang = '<?= $pixabay_images_settings['language']?$pixabay_images_settings['language']:substr(get_locale(), 0, 2) ?>',
     102                safesearch = '<?= $pixabay_images_settings['safesearch']=='true'?'true':'false' ?>',
    102103                per_page = 30, form = jQuery('#pixabay_images_form'), hits, q, image_type, orientation;
    103104
     
    117118            function call_api(q, p){
    118119                var xhr = new XMLHttpRequest();
    119                 xhr.open('GET', 'https://pixabay.com/api/?key=27347-23fd1708b1c4f768195a5093b&response_group=high_resolution&lang='+lang+'&image_type='+image_type+'&orientation='+orientation+'&per_page='+per_page+'&page='+p+'&search_term='+encodeURIComponent(q));
     120                xhr.open('GET', 'https://pixabay.com/api/?key=27347-23fd1708b1c4f768195a5093b&response_group=high_resolution&lang='+lang+'&safesearch='+safesearch+'&image_type='+image_type+'&orientation='+orientation+'&per_page='+per_page+'&page='+p+'&search_term='+encodeURIComponent(q));
    120121                xhr.onreadystatechange = function(){
    121122                    if (this.status == 200 && this.readyState == 4) {
     
    187188    $pixabay_images_settings = get_option('pixabay_images_options');
    188189
    189     // parse image_url
    190     $url = str_replace('https:', 'http:', $_POST['image_url']);
    191     $parsed_url = parse_url($url);
    192     if(strcmp($parsed_url['host'], 'pixabay.com')) {
    193         die('Error: Invalid host in URL (must be pixabay.com)');
    194     }
    195 
    196190    // get image file
    197     $response = wp_remote_get($url);
     191    $response = wp_remote_get($_POST['image_url']);
    198192    if (is_wp_error($response)) die('Error: '.$response->get_error_message());
    199193
     
    206200        $q_tags[$k] = trim($v);
    207201    }
    208     $path_info = pathinfo($url);
     202    $path_info = pathinfo($_POST['image_url']);
    209203    $file_name = sanitize_file_name(implode('_', $q_tags).'_'.time().'.'.$path_info['extension']);
    210204
  • pixabay-images/trunk/readme.txt

    r1717044 r1772686  
    44Tags: images, photos, pictures, cliparts, clip arts, illustrations, vectors, vector graphics, stock photos, stock images, stock pictures, royalty-free, public domain, pd, copyright-free, free, free images, cc0, cc, creative commons, commercial use, insert, search, upload, media
    55Requires at least: 3.5.1
    6 Tested up to: 4.8.1
    7 Stable tag: 3.0
     6Tested up to: 4.9
     7Stable tag: 3.1
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15 [Pixabay Images](https://pixabay.com/blog/posts/p-50/) is a WordPress plugin that let's you pick CC0 public domain pictures from [Pixabay](https://pixabay.com/) and insert them with just a click anywhere on your blog. The images are safe to use, and paying attribution or linking back to the source is not required.
     15[Pixabay Images](https://pixabay.com/blog/posts/p-136/) is a WordPress plugin that let's you pick CC0 public domain pictures from [Pixabay](https://pixabay.com/) and insert them with just a click anywhere on your blog. The images are safe to use, and paying attribution or linking back to the source is not required.
    1616
    1717Features include:
     
    2424* Unobtrusive integration into WordPress.
    2525
    26 For more information, check out [Pixabay.com](https://pixabay.com/blog/posts/p-50/).
     26For more information, check out [Pixabay.com](https://pixabay.com/blog/posts/p-136/).
    2727
    2828== Installation ==
     
    157157* Larger preview images.
    158158
     159= 3.1 =
     160
     161* Compatibility tested for WordPress 4.9
     162* Included SafeSearch filter in settings
     163* Fixed https://wordpress.org/support/topic/error-file-attachment-metadata-error-3/
     164
    159165== Upgrade Notice ==
    160166
  • pixabay-images/trunk/settings.php

    r1717044 r1772686  
    1414    add_settings_section('pixabay_images_options_section', '', '', 'pixabay_images_settings');
    1515    add_settings_field('language-id', __('Language', 'pixabay_images'), 'pixabay_images_render_language', 'pixabay_images_settings', 'pixabay_images_options_section');
     16    add_settings_field('safesearch-id', 'SafeSearch', 'pixabay_images_render_safesearch', 'pixabay_images_settings', 'pixabay_images_options_section');
    1617    add_settings_field('attribution-id', __('Attribution', 'pixabay_images'), 'pixabay_images_render_attribution', 'pixabay_images_settings', 'pixabay_images_options_section');
    1718    add_settings_field('button-id', __('Button', 'pixabay_images'), 'pixabay_images_render_button', 'pixabay_images_settings', 'pixabay_images_options_section');
     
    2728    foreach ($pixabay_images_gallery_languages as $k => $v) { echo '<option value="'.$k.'"'.($options['language']==$k?' selected="selected"':'').'>'.$v.'</option>'; }
    2829    echo '</select>';
     30}
     31
     32function pixabay_images_render_safesearch(){
     33    $options = get_option('pixabay_images_options');
     34    echo '<label><input name="pixabay_images_options[safesearch]" value="true" type="checkbox"'.($options['safesearch']=='true'?' checked="checked"':'').'> '.__('Exclude inappropriate or explicit images', 'pixabay_images').'</label>';
    2935}
    3036
     
    6470    $options = get_option('pixabay_images_options');
    6571    if ($pixabay_images_gallery_languages[$input['language']]) $options['language'] = $input['language'];
     72    if ($input['safesearch']) $options['safesearch'] = 'true'; else $options['safesearch'] = 'false';
    6673    if ($input['attribution']) $options['attribution'] = 'true'; else $options['attribution'] = 'false';
    6774    if ($input['button']) $options['button'] = 'true'; else $options['button'] = 'false';
Note: See TracChangeset for help on using the changeset viewer.