Skip to content

Commit

Permalink
Merge pull request #186 from xwp/1.0
Browse files Browse the repository at this point in the history
Version 1.0.0
  • Loading branch information
derekherman committed Jul 21, 2020
2 parents dd92192 + 75b7bb0 commit dee982a
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function( grunt ) {
command: './vendor/xwp/wp-dev-lib/scripts/generate-markdown-readme', // Generate the readme.md.
},
create_build_zip: {
command: 'if [ ! -e build ]; then echo "Run grunt build first."; exit 1; fi; if [ -e unsplash.zip ]; then rm unsplash.zip; fi; cd build; zip -r ../unsplash.zip .; cd ..; echo; echo "ZIP of build: $(pwd)/unsplash.zip"',
command: 'if [ ! -e build ]; then echo "Run grunt build first."; exit 1; fi; if [ -e unsplash.zip ]; then rm unsplash.zip; fi; mv build unsplash; zip -r ./unsplash.zip unsplash; mv unsplash build; echo; echo "ZIP of build: $(pwd)/unsplash.zip"',
},
},

Expand Down
20 changes: 10 additions & 10 deletions assets/src/admin/style.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@

.settings_page_unsplash {

& .notice,
& div.error,
& div.updated {
.notice,
div.error,
div.updated {
margin: 18px 18px 2px 0;
}

& p.submit {
p.submit {
margin-top: 0;
margin-bottom: 20px;
}

& .notice-unsplash {
.notice-unsplash {
padding: 12px;
margin-left: 0;
}

& form {
form {
max-width: 800px;
}

& .unsplash-icon {
.unsplash-icon {
height: 1.5em;
padding-left: 0.3em;
vertical-align: sub;
Expand All @@ -31,11 +30,12 @@

.notice-unsplash-global {

& h3 {
h3 {
margin-top: 1em;
margin-bottom: 0.3em;
}

& p {
p {
margin-bottom: 1em;
}
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"title": "Unsplash",
"description": "Unsplash for WordPress.",
"author": "XWP",
"author": "Unsplash",
"license": "GPL-2.0-or-later",
"keywords": [
"wordpress",
Expand Down Expand Up @@ -116,6 +116,7 @@
"build:run": "grunt build",
"build:zip": "grunt create-build-zip",
"dev": "wp-scripts start",
"deploy": "grunt deploy",
"docker": "docker-compose run --rm -u 1000 --workdir=/var/www/html/wp-content/plugins/unsplash wordpress",
"env:logs": "bin/logs.sh",
"env:start": "bin/start.sh",
Expand Down
2 changes: 1 addition & 1 deletion php/class-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function get_missing_credentials_message() {
$message = esc_html__( 'To complete setup of the Unsplash plugin you will need to add the API access key.', 'unsplash' );
$url = get_admin_url( null, 'options-general.php?page=unsplash' );

$cta_link = sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html__( 'Unspash settings page', 'unsplash' ) );
$cta_link = sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html__( 'Unsplash settings page', 'unsplash' ) );
$cta_text = sprintf(
/* translators: %s: Link to Unsplash settings page. */
esc_html__( 'Visit the %s to complete the process.', 'unsplash' ),
Expand Down
2 changes: 1 addition & 1 deletion php/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function settings_page_render() {
?>
</p>
<p>
<i><?php esc_html_e( 'Note: This action will break your current connection to Unsplash but will not remove any images previously published or imported to your media library.', 'unsplash' ); ?></i>
<i><?php esc_html_e( 'Note: While this action will disconnect your current OAuth integration to Unsplash, it will not remove any images previously published or imported to your media library.', 'unsplash' ); ?></i>
</p>
</form>
<?php
Expand Down
64 changes: 34 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
![Banner](wp-assets/banner-1544x500.png)
Search and use the internet’s largest library of freely usable images from [Unsplash](https://unsplash.com) right from the WordPress editor.

**Contributors:** [xwp](https://profiles.wordpress.org/xwp), [unsplash](https://profiles.wordpress.org/unsplash)
**Tags:** [Unsplash](https://wordpress.org/plugins/tags/Unsplash), [images](https://wordpress.org/plugins/tags/images), [media](https://wordpress.org/plugins/tags/media), [free](https://wordpress.org/plugins/tags/free), [photographs](https://wordpress.org/plugins/tags/photographs), [photos](https://wordpress.org/plugins/tags/photos)
**Requires at least:** 4.9
**Tested up to:** 5.4.2
**Stable tag:** 1.0.0-rc2
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
**Requires PHP:** 5.6.20
**Contributors:** [unsplash](https://profiles.wordpress.org/unsplash), [xwp](https://profiles.wordpress.org/xwp)
**Tags:** [unsplash](https://wordpress.org/plugins/tags/unsplash), [images](https://wordpress.org/plugins/tags/images), [media](https://wordpress.org/plugins/tags/media), [free](https://wordpress.org/plugins/tags/free), [photographs](https://wordpress.org/plugins/tags/photographs), [photos](https://wordpress.org/plugins/tags/photos)
**Requires at least:** 4.9
**Tested up to:** 5.4.2
**Stable tag:** 1.0.0
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
**Requires PHP:** 5.6.20

[![Build Status](https://travis-ci.com/xwp/unsplash-wp.svg?token=DzyA3Sey2BLS5sL6HDJq&branch=develop)](https://travis-ci.com/xwp/unsplash-wp) [![Coverage Status](https://coveralls.io/repos/xwp/unsplash-wp/badge.svg?branch=develop&service=github&t=mLvdmf)](https://coveralls.io/github/xwp/unsplash-wp) [![Built with Grunt](https://gruntjs.com/cdn/builtwith.svg)](http://gruntjs.com)
[![Build Status](https://travis-ci.com/xwp/unsplash-wp.svg?token=DzyA3Sey2BLS5sL6HDJq&branch=develop)](https://travis-ci.com/xwp/unsplash-wp) [![Coverage Status](https://coveralls.io/repos/xwp/unsplash-wp/badge.svg?branch=develop&service=github&t=mLvdmf)](https://coveralls.io/github/xwp/unsplash-wp) [![Built with Grunt](https://gruntjs.com/cdn/builtwith.svg)](http://gruntjs.com)

## Description ##

Expand All @@ -24,19 +24,30 @@ Search for the perfect image for your content from [Unsplash](https://unsplash.c
## Adding images to your content
Adding an image to your post is super easy. With one click the image is added both to your post, and automatically downloaded and added to your Media Library. *Supports both the Block Editor and Classic Editor.*

Features
* Free Images: All images are completely free to use for both commercial and personal uses. No strings attached.
* Keyword search: Search from our massive library of millions of free to use images using keyword search.
* Easy to access: The Unsplash tab is presented whenever you want to add an image.
* Media Library Integration: the images you select are automatically added to your WordPress site's Media Library.
* Save time: No more having to source the image you need, download it, and upload it to your Media Library, the Unsplash plugin makes it easy for you and saves you time.
* Custom Gutenberg block: easily search and select Unsplash images from the Unsplash Gutenberg block
* Featured images: Support for adding images from Unsplash as your content's Featured image.
* Hotlinking: Automatically hotlink images in your site to the Unsplash CDN, reducing your site's bandwidth usage and speeding up delivery.
* Performance: Automatically serve the right size image to your users regardless of device and connection speed using Unsplash’s state-of-the-art CDN.
* Accessibility: Automatically include a relevant alt description for screen readers, visually reduced users, and SEO.
* Graceful Failover: Intelligent plugin design ensures that your site's images will continue to appear to the user even if the Unsplash plugin is no longer active.
* Caption support: For themes that support display of the caption this will be provided automatically.
Features and capabilities provided by the plugin include:

- **Free Images**: All images are completely free to use for both commercial and personal uses. No strings attached.
- **Keyword search**: Search from our massive library of millions of free to use images using keyword search.
- **Easy to access**: The Unsplash tab is presented whenever you want to add an image.
- **Media Library Integration**: the images you select are automatically added to your WordPress site's Media Library.
- **Save time**: No more having to source the image you need, download it, and upload it to your Media Library, the Unsplash plugin makes it easy for you and saves you time.
- **Featured images**: Support for adding images from Unsplash as your content's Featured image.
- **Hotlinking**: Automatically hotlink images in your site to the Unsplash CDN, reducing your site's bandwidth usage and speeding up delivery.
- **Performance**: Automatically serve the right size image to your users regardless of device and connection speed using Unsplash’s state-of-the-art CDN.
- **Accessibility**: Automatically include a relevant alt description for screen readers, visually reduced users, and SEO.
- **Graceful Failover**: Intelligent plugin design ensures that your site's images will continue to appear to the user even if the Unsplash plugin is no longer active.
- **Caption support**: For themes that support display of the caption this will be provided automatically.

## Frequently Asked Questions ##

### I can use these images for free? ###
All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible.

For more details about our licensing please [Read our FAQ](https://help.unsplash.com/en/collections/1463188-unsplash-license).

### Do I need an Unsplash account? ###
Yes, as part of the plugin's setup, you will be directed to the Unsplash website and be guided through the onboarding process, which will ask you to either sign up for a new account, or log in with your existing account.


## Installation ##

Expand Down Expand Up @@ -66,14 +77,7 @@ Features

![Performance and Accessibility: The right image size and alt-text automatically added for accessibility and SEO.](wp-assets/screenshot-5.jpg)

## Frequently Asked Questions ##

### I can use these images for free? ###
All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible.

For more details about our licensing please [Read our FAQ](https://help.unsplash.com/en/collections/1463188-unsplash-license).

### Do I need an Unsplash account ? ###
Yes, as part of the plugin's setup, you will be directed to the Unsplash website and be guided through the onboarding process, which will ask you to either sign up for a new account, or log in with your existing account.
## Changelog ##

For the plugin’s changelog, please see [the Releases page on GitHub](https://github.com/xwp/unsplash-wp/releases).

52 changes: 30 additions & 22 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Unsplash ===
Contributors: XWP, Unsplash
Tags: Unsplash, images, media, free, photographs, photos
Contributors: unsplash, xwp
Tags: unsplash, images, media, free, photographs, photos
Requires at least: 4.9
Stable tag: 1.0.0-rc2
Stable tag: 1.0.0
Tested up to: 5.4.2
Requires PHP: 5.6.20
License: GPLv2 or later
Expand All @@ -11,6 +11,7 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html
Search and use the internet’s largest library of freely usable images from [Unsplash](https://unsplash.com) right from the WordPress editor.

== Description ==

With Unsplash for Wordpress, searching the internet’s largest library of freely usable images for your posts and pages is easier than ever. Right from the WordPress editor, you can access millions of HD photos for free, with no strings attached.

## Search
Expand All @@ -19,20 +20,32 @@ Search for the perfect image for your content from [Unsplash](https://unsplash.c
## Adding images to your content
Adding an image to your post is super easy. With one click the image is added both to your post, and automatically downloaded and added to your Media Library. *Supports both the Block Editor and Classic Editor.*

Features
* Free Images: All images are completely free to use for both commercial and personal uses. No strings attached.
* Keyword search: Search from our massive library of millions of free to use images using keyword search.
* Easy to access: The Unsplash tab is presented whenever you want to add an image.
* Media Library Integration: the images you select are automatically added to your WordPress site's Media Library.
* Save time: No more having to source the image you need, download it, and upload it to your Media Library, the Unsplash plugin makes it easy for you and saves you time.
* Featured images: Support for adding images from Unsplash as your content's Featured image.
* Hotlinking: Automatically hotlink images in your site to the Unsplash CDN, reducing your site's bandwidth usage and speeding up delivery.
* Performance: Automatically serve the right size image to your users regardless of device and connection speed using Unsplash’s state-of-the-art CDN.
* Accessibility: Automatically include a relevant alt description for screen readers, visually reduced users, and SEO.
* Graceful Failover: Intelligent plugin design ensures that your site's images will continue to appear to the user even if the Unsplash plugin is no longer active.
* Caption support: For themes that support display of the caption this will be provided automatically.
Features and capabilities provided by the plugin include:

- **Free Images**: All images are completely free to use for both commercial and personal uses. No strings attached.
- **Keyword search**: Search from our massive library of millions of free to use images using keyword search.
- **Easy to access**: The Unsplash tab is presented whenever you want to add an image.
- **Media Library Integration**: the images you select are automatically added to your WordPress site's Media Library.
- **Save time**: No more having to source the image you need, download it, and upload it to your Media Library, the Unsplash plugin makes it easy for you and saves you time.
- **Featured images**: Support for adding images from Unsplash as your content's Featured image.
- **Hotlinking**: Automatically hotlink images in your site to the Unsplash CDN, reducing your site's bandwidth usage and speeding up delivery.
- **Performance**: Automatically serve the right size image to your users regardless of device and connection speed using Unsplash’s state-of-the-art CDN.
- **Accessibility**: Automatically include a relevant alt description for screen readers, visually reduced users, and SEO.
- **Graceful Failover**: Intelligent plugin design ensures that your site's images will continue to appear to the user even if the Unsplash plugin is no longer active.
- **Caption support**: For themes that support display of the caption this will be provided automatically.

== Frequently Asked Questions ==

= I can use these images for free? =
All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible.

For more details about our licensing please [Read our FAQ](https://help.unsplash.com/en/collections/1463188-unsplash-license).

= Do I need an Unsplash account? =
Yes, as part of the plugin's setup, you will be directed to the Unsplash website and be guided through the onboarding process, which will ask you to either sign up for a new account, or log in with your existing account.

== Installation ==

1. Upload plugin folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the "Plugins" menu in WordPress.
3. Connect the plugin to the Unsplash.com by logging in and authorizing your site.
Expand All @@ -45,11 +58,6 @@ Features
4. Classic and Block editor compatible: Add Unsplash images via the Block editor or using the Classic Media button.
5. Performance and Accessibility: The right image size and alt-text automatically added for accessibility and SEO.

== Frequently Asked Questions ==
= I can use these images for free? =
All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible.

For more details about our licensing please [Read our FAQ](https://help.unsplash.com/en/collections/1463188-unsplash-license).
== Changelog ==

= Do I need an Unsplash account ? =
Yes, as part of the plugin's setup, you will be directed to the Unsplash website and be guided through the onboarding process, which will ask you to either sign up for a new account, or log in with your existing account.
For the plugin’s changelog, please see [the Releases page on GitHub](https://github.com/xwp/unsplash-wp/releases).
4 changes: 2 additions & 2 deletions tests/phpunit/php/class-test-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function test_no_check_api_credentials() {
$api = new API( $plugin );
$wp_error = $api->check_api_credentials();
$this->assertEquals( $wp_error->get_error_code(), 'missing_api_credential' );
$this->assertEquals( wp_strip_all_tags( $wp_error->get_error_message() ), 'To complete setup of the Unsplash plugin you will need to add the API access key.Visit the Unspash settings page to complete the process.' );
$this->assertEquals( wp_strip_all_tags( $wp_error->get_error_message() ), 'To complete setup of the Unsplash plugin you will need to add the API access key.Visit the Unsplash settings page to complete the process.' );
remove_filter( 'unsplash_api_credentials', [ $this, 'disable_unsplash_api_credentials' ] );
}

Expand All @@ -178,7 +178,7 @@ public function test_no_check_api_credentials_again() {
$api = new API( $plugin );
$wp_error = $api->get( 'uYpOYyJdhRE' );
$this->assertEquals( $wp_error->get_error_code(), 'missing_api_credential' );
$this->assertEquals( wp_strip_all_tags( $wp_error->get_error_message() ), 'To complete setup of the Unsplash plugin you will need to add the API access key.Visit the Unspash settings page to complete the process.' );
$this->assertEquals( wp_strip_all_tags( $wp_error->get_error_message() ), 'To complete setup of the Unsplash plugin you will need to add the API access key.Visit the Unsplash settings page to complete the process.' );
remove_filter( 'unsplash_api_credentials', [ $this, 'disable_unsplash_api_credentials' ] );
}

Expand Down
8 changes: 4 additions & 4 deletions unsplash.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Plugin Name: Unsplash
* Plugin URI: https://github.com/xwp/unsplash-wp
* Description: Unsplash for WordPress.
* Version: 1.0.0-rc2
* Author: XWP
* Author URI: https://xwp.co/
* Version: 1.0.0
* Author: Unsplash
* Author URI: https://unsplash.com/
* License: GPLv2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: unsplash
* Domain Path: /languages
* Requires at least: 4.9
* Requires PHP: 5.6
*
* Copyright (c) 2020 XWP (https://xwp.co/)
* Copyright (c) 2020 Unsplash (https://unsplash.com/)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
Expand Down

0 comments on commit dee982a

Please sign in to comment.