Skip to content

Commit

Permalink
Release v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
azurecurve committed Sep 17, 2022
1 parent 1fb4500 commit c2d20e4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 30 deletions.
25 changes: 13 additions & 12 deletions azrcrv-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ------------------------------------------------------------------------------
* Plugin Name: Avatars
* Description: Allow users to upload their own avatar.
* Version: 2.2.1
* Version: 2.2.2
* Author: azurecurve
* Author URI: https://development.azurecurve.co.uk/classicpress-plugins/
* Plugin URI: https://development.azurecurve.co.uk/classicpress-plugins/avatars/
Expand Down Expand Up @@ -35,6 +35,7 @@
const PLUGIN_SLUG = 'azrcrv-' . PLUGIN_SHORT_SLUG;
const PLUGIN_HYPHEN = 'azrcrv-a';
const PLUGIN_UNDERSCORE = 'azrcrv_a';
const PLUGIN_FILE = __FILE__;

/**
* Prevent direct access.
Expand All @@ -46,50 +47,50 @@
/**
* Include plugin Menu Client.
*/
require_once dirname( __FILE__ ) . '/includes/azurecurve-menu-populate.php';
require_once dirname( __FILE__ ) . '/includes/azurecurve-menu-display.php';
require_once dirname( PLUGIN_FILE ) . '/includes/azurecurve-menu-populate.php';
require_once dirname( PLUGIN_FILE ) . '/includes/azurecurve-menu-display.php';

/**
* Include Update Client.
*/
require_once dirname( __FILE__ ) . '/libraries/updateclient/UpdateClient.class.php';
require_once dirname( PLUGIN_FILE ) . '/libraries/updateclient/UpdateClient.class.php';

/**
* Include setup of registration activation hook, actions, filters and shortcodes.
*/
require_once dirname( __FILE__ ) . '/includes/setup.php';
require_once dirname( PLUGIN_FILE ) . '/includes/setup.php';

/**
* Load styles functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-styles.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-styles.php';

/**
* Load scripts functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-scripts.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-scripts.php';

/**
* Load menu functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-menu.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-menu.php';

/**
* Load language functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-language.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-language.php';

/**
* Load plugin image functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-plugin-images.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-plugin-images.php';

/**
* Load settings functions.
*/
require_once dirname( __FILE__ ) . '/includes/functions-settings.php';
require_once dirname( PLUGIN_FILE ) . '/includes/functions-settings.php';

/**
* Load plugin functionality.
*/
require_once dirname( __FILE__ ) . '/includes/plugin-functionality.php';
require_once dirname( PLUGIN_FILE ) . '/includes/plugin-functionality.php';
16 changes: 2 additions & 14 deletions includes/functions-plugin-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@

/**
* Declare the Namespace.
*
* @since 1.0.0
*/
namespace azurecurve\Avatars;

/**
* Custom plugin image path.
*
* @since 1.2.0
*/
function custom_image_path( $path ) {
if ( strpos( $path, PLUGIN_SLUG ) !== false ) {
$path = plugin_dir_path( __FILE__ ) . '../assets/images';
}
return $path;
return plugin_dir_path( PLUGIN_FILE ) . 'assets/images';
}

/**
* Custom plugin image url.
*
* @since 1.2.0
*/
function custom_image_url( $url ) {
if ( strpos( $url, PLUGIN_SLUG ) !== false ) {
$url = esc_url_raw( plugin_dir_url( __FILE__ ) . '../assets/images' );
}
return $url;
return esc_url_raw( plugin_dir_url( PLUGIN_FILE ) . 'assets/images' );
}
7 changes: 5 additions & 2 deletions includes/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@

// add filters.
add_filter( 'plugin_action_links', __NAMESPACE__ . '\\add_plugin_action_link', 10, 2 );
add_filter( 'codepotent_update_manager_image_path', __NAMESPACE__ . '\\custom_image_path' );
add_filter( 'codepotent_update_manager_image_url', __NAMESPACE__ . '\\custom_image_url' );

$plugin_slug_for_um = plugin_basename( trim( PLUGIN_FILE ) );
add_filter( 'codepotent_update_manager_' . $plugin_slug_for_um . '_image_path', __NAMESPACE__ . '\\custom_image_path' );
add_filter( 'codepotent_update_manager_' . $plugin_slug_for_um . '_image_url', __NAMESPACE__ . '\\custom_image_url' );


// add additional filters.
add_filter( 'avatar_defaults', __NAMESPACE__ . '\\set_default_avatar' );
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== Avatars ===

Description: Change the default avatar and allow users to upload their own.
Version: 2.2.1
Version: 2.2.2
Tags: avatar,profile picture,gravatar
Author: azurecurve
Author URI: https://development.azurecurve.co.uk/
Plugin URI: https://development.azurecurve.co.uk/classicpress-plugins/avatars/
Download link: https://github.com/azurecurve/azrcrv-avatars/releases/download/v2.2.1/azrcrv-avatars.zip
Download link: https://github.com/azurecurve/azrcrv-avatars/releases/download/v2.2.2/azrcrv-avatars.zip
Donate link: https://development.azurecurve.co.uk/support-development/
Requires PHP: 5.6
Requires: 1.0.0
Expand Down Expand Up @@ -51,6 +51,9 @@ This plugin is developed for ClassicPress, but will likely work on WordPress.

# Changelog

### [Version 2.2.2](https://github.com/azurecurve/azrcrv-avatars/releases/tag/v2.2.2)
* Fix Update Manager View Details link (contributed by xxsimoxx).

### [Version 2.2.1](https://github.com/azurecurve/azrcrv-avatars/releases/tag/v2.2.1)
* Fix missing constants.

Expand Down

0 comments on commit c2d20e4

Please sign in to comment.