Skip to content

Commit

Permalink
Merge pull request #6 from WordImpress/release/1.8.8
Browse files Browse the repository at this point in the history
Release/1.8.8
  • Loading branch information
mehul0810 authored May 24, 2017
2 parents 4943f51 + 1eef9b3 commit f06b164
Show file tree
Hide file tree
Showing 86 changed files with 1,281 additions and 969 deletions.
4 changes: 2 additions & 2 deletions assets/css/give-admin-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ div.cmb-type-levels-repeater-header + div.cmb-repeat-group-wrap {
margin-left: -4px; }

.give-money-symbol-after {
margin-right: -1px; }
margin-right: -5px; }

.give_options_panel input[type="text"] {
padding: 5px;
Expand Down Expand Up @@ -1118,7 +1118,7 @@ ASIDE
display: block;
position: absolute;
bottom: 0;
right: 170px;
right: 166px;
width: 170px;
max-height: 250px;
overflow-y: scroll; }
Expand Down
2 changes: 1 addition & 1 deletion assets/css/give-admin-rtl.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/css/give-admin.css

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

2 changes: 1 addition & 1 deletion assets/css/give-admin.min.css

Large diffs are not rendered by default.

Binary file added assets/images/admin/give-form-mockup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/give-form-mockup.png
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/scss/admin/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ div.cmb-type-levels-repeater-header + div.cmb-repeat-group-wrap {

.give-money-symbol-after {
//border-left: 0;
margin-left: -1px;
margin-left: -5px;
}

.give_options_panel input[ type="text"] {
Expand Down Expand Up @@ -641,7 +641,7 @@ ASIDE
display: block;
position: absolute;
bottom: 0;
left: 170px;
left: 166px;
width: 170px;
max-height: 250px;
overflow-y: scroll;
Expand Down
2 changes: 1 addition & 1 deletion assets/sourcemaps/give-admin.css.map

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: WordImpress
* Author URI: https://wordimpress.com
* Version: 1.8.7.1
* Version: 1.8.8
* Text Domain: give
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WordImpress/Give
Expand Down Expand Up @@ -268,7 +268,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '1.8.7.1' );
define( 'GIVE_VERSION', '1.8.8' );
}

// Plugin Folder Path
Expand Down Expand Up @@ -372,9 +372,9 @@ private function includes() {
require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';

if( defined( 'WP_CLI' ) && WP_CLI ) {
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
}

if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {

Expand All @@ -397,18 +397,22 @@ private function includes() {
require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php';

require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';

require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';

require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/tools-actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';

require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';

require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
Expand Down Expand Up @@ -467,8 +471,8 @@ public function load_textdomain() {


/**
* Start Give
*
* Start Give
*
* The main function responsible for returning the one true Give instance to functions everywhere.
*
* Use this function like you would a global variable, except without needing
Expand All @@ -477,7 +481,7 @@ public function load_textdomain() {
* Example: <?php $give = Give(); ?>
*
* @since 1.0
* @return object|Give
* @return object|Give
*/
function Give() {
return Give::instance();
Expand Down
2 changes: 1 addition & 1 deletion includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function give_connect_donor_to_wpuser( $user_id, $user_data ){
// Update user_id meta in payments.
if( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) {
foreach ( $donations as $donation ) {
update_post_meta( $donation, '_give_payment_user_id', $user_id );
give_update_meta( $donation, '_give_payment_user_id', $user_id );
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions includes/admin/admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ function give_reports_page_pages( $settings ) {
// Gateways.
include( 'reporting/class-settings-gateways.php' ),

// Export.
include( 'reporting/class-settings-export.php' ),
);

// Output.
Expand Down Expand Up @@ -434,6 +432,10 @@ function give_tools_page_pages( $settings ) {

// Data.
include( 'tools/class-settings-data.php' ),

// Export.
include( 'tools/class-settings-export.php' ),

);

// Output.
Expand Down
18 changes: 13 additions & 5 deletions includes/admin/class-addon-activation-banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ public function init() {
add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );

// File path of addon must be included in banner detail other addon activate meta will not delete.
add_action( 'deactivate_' . $this->get_plugin_file_name(), array( $this, 'remove_addon_activate_meta' ) );
$file_name = $this->get_plugin_file_name();

if ( ! empty( $file_name ) ) {
add_action( 'deactivate_' . $file_name, array( $this, 'remove_addon_activate_meta' ) );
}
}


Expand Down Expand Up @@ -312,19 +316,23 @@ private function get_plugin_file_name() {
$file_name = current( explode( '/', $file_path ) );
}

if ( empty( $file_name ) ) {
return false;
}

foreach ( $active_plugins as $plugin ) {
if ( false !== strpos( $plugin, $file_name ) ) {
$file_name = $plugin;
break;
}
}
} else {
throw new Exception( __( "File path must be added of {$this->banner_details['name']} addon in banner details.", 'give' ) );
} elseif ( WP_DEBUG ) {
throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) );
}

// Check plugin path calculated by addon file path.
if ( empty( $file_name ) ) {
throw new Exception( __( "Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give' ) );
if ( empty( $file_name ) && WP_DEBUG ) {
throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) );
}

} catch ( Exception $e ) {
Expand Down
21 changes: 17 additions & 4 deletions includes/admin/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,27 @@ class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_att

// Custom: Log field.
case 'logs' :
// Note: there are no need to check for html field param because we want custom html to this field.
give_reports_tab_logs();

include GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';

// Get current section.
$current_section = $_GET['section'] = give_get_current_setting_section();

/**
* Fires the in report page logs view.
*
* @since 1.0
*/
do_action( "give_logs_view_{$current_section}" );

echo $description;
break;

// Custom: API field.
// Custom: Data field.
case 'data' :
give_tools_recount_stats_display();

include GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-data.php';

echo $description;
break;

Expand Down
53 changes: 48 additions & 5 deletions includes/admin/class-give-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1128,19 +1128,62 @@ function give_get_featured_image_sizes() {
$get_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
}

// This will help us to filter special characters from a string
$filter_slug_items = array( '_', '-' );

foreach ( $get_sizes as $_size ) {

if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
}
// Check for height of image having 0 or 9999 in pixels to label them as responsive
$is_image_size_responsive = false;
if( 0 == get_option( "{$_size}_size_h" ) || 9999 == get_option( "{$_size}_size_h" ) ){
$is_image_size_responsive = true;
}

// Converting image size slug to title case
$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );

if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
$sizes[ $_size ] .= ' (' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
}

// Based on the above image height check, label the respective resolution as responsive
if($is_image_size_responsive){
$sizes[ $_size ] .= ' - responsive';
}
$sizes[ $_size ] .= ')';

}

return apply_filters( 'give_get_featured_image_sizes', $sizes );
}


/**
* Slug to Title
*
* Converts a string with hyphen(-) or underscores(_) or any special character to a string with Title case
*
* @since 1.8.8
*
* @params $string text
* @params $filter array
*
* @return text $string
*/
function give_slug_to_title( $string, $filters = array() ){

foreach( $filters as $filter_item ){
$string = str_replace( $filter_item, ' ', $string );
}

// Return updated string after converting it to title case
return ucwords( $string );

}


/**
* Give License Key Callback
*
Expand Down
Loading

0 comments on commit f06b164

Please sign in to comment.