@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_API' ) ) : |
|
| 16 | +if ( ! class_exists('Give_Settings_API')) : |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_API. |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct() { |
| 36 | 36 | $this->id = 'api'; |
| 37 | - $this->label = esc_html__( 'API', 'give' ); |
|
| 37 | + $this->label = esc_html__('API', 'give'); |
|
| 38 | 38 | |
| 39 | 39 | parent::__construct(); |
| 40 | 40 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function get_settings() { |
| 49 | 49 | // Get settings. |
| 50 | - $settings = apply_filters( 'give_settings_api', array( |
|
| 50 | + $settings = apply_filters('give_settings_api', array( |
|
| 51 | 51 | array( |
| 52 | 52 | 'id' => 'give_tools_api', |
| 53 | 53 | 'type' => 'title', |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ), |
| 56 | 56 | array( |
| 57 | 57 | 'id' => 'api', |
| 58 | - 'name' => esc_html__( 'API', 'give' ), |
|
| 58 | + 'name' => esc_html__('API', 'give'), |
|
| 59 | 59 | 'type' => 'api', |
| 60 | 60 | ), |
| 61 | 61 | array( |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @since 1.8 |
| 72 | 72 | * @param array $settings |
| 73 | 73 | */ |
| 74 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
| 74 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
| 75 | 75 | |
| 76 | 76 | // Output. |
| 77 | 77 | return $settings; |
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_Data' ) ) : |
|
| 16 | +if ( ! class_exists('Give_Settings_Data')) : |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_Data. |
@@ -35,14 +35,14 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function __construct() { |
| 37 | 37 | $this->id = 'data'; |
| 38 | - $this->label = esc_html__( 'Data', 'give' ); |
|
| 38 | + $this->label = esc_html__('Data', 'give'); |
|
| 39 | 39 | |
| 40 | 40 | parent::__construct(); |
| 41 | 41 | |
| 42 | 42 | // Do not use main form for this tab. |
| 43 | - if( give_get_current_setting_tab() === $this->id ) { |
|
| 44 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
| 45 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
| 43 | + if (give_get_current_setting_tab() === $this->id) { |
|
| 44 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
| 45 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function get_settings() { |
| 56 | 56 | // Get settings. |
| 57 | - $settings = apply_filters( 'give_settings_data', array( |
|
| 57 | + $settings = apply_filters('give_settings_data', array( |
|
| 58 | 58 | array( |
| 59 | 59 | 'id' => 'give_tools_tools', |
| 60 | 60 | 'type' => 'title', |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ), |
| 63 | 63 | array( |
| 64 | 64 | 'id' => 'api', |
| 65 | - 'name' => esc_html__( 'Tools', 'give' ), |
|
| 65 | + 'name' => esc_html__('Tools', 'give'), |
|
| 66 | 66 | 'type' => 'data', |
| 67 | 67 | ), |
| 68 | 68 | array( |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @since 1.8 |
| 79 | 79 | * @param array $settings |
| 80 | 80 | */ |
| 81 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
| 81 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
| 82 | 82 | |
| 83 | 83 | // Output. |
| 84 | 84 | return $settings; |
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_Import' ) ) { |
|
| 16 | +if ( ! class_exists('Give_Settings_Import')) { |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_Import. |
@@ -45,23 +45,23 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function __construct() { |
| 47 | 47 | $this->id = 'import'; |
| 48 | - $this->label = __( 'Import', 'give' ); |
|
| 48 | + $this->label = __('Import', 'give'); |
|
| 49 | 49 | |
| 50 | 50 | parent::__construct(); |
| 51 | 51 | |
| 52 | 52 | // Will display html of the import donation. |
| 53 | - add_action( 'give_admin_field_tools_import', array( |
|
| 53 | + add_action('give_admin_field_tools_import', array( |
|
| 54 | 54 | 'Give_Settings_Import', |
| 55 | 55 | 'render_import_field', |
| 56 | - ), 10, 2 ); |
|
| 56 | + ), 10, 2); |
|
| 57 | 57 | |
| 58 | 58 | // Do not use main form for this tab. |
| 59 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
| 60 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
| 61 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
| 59 | + if (give_get_current_setting_tab() === $this->id) { |
|
| 60 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
| 61 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
| 62 | 62 | |
| 63 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/import/class-give-import-donations.php'; |
|
| 64 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/import/class-give-import-core-settings.php'; |
|
| 63 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/import/class-give-import-donations.php'; |
|
| 64 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/import/class-give-import-core-settings.php'; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param array $settings |
| 81 | 81 | */ |
| 82 | 82 | $settings = apply_filters( |
| 83 | - 'give_get_settings_' . $this->id, |
|
| 83 | + 'give_get_settings_'.$this->id, |
|
| 84 | 84 | array( |
| 85 | 85 | array( |
| 86 | 86 | 'id' => 'give_tools_import', |
@@ -89,14 +89,14 @@ discard block |
||
| 89 | 89 | ), |
| 90 | 90 | array( |
| 91 | 91 | 'id' => 'import', |
| 92 | - 'name' => __( 'Import', 'give' ), |
|
| 92 | + 'name' => __('Import', 'give'), |
|
| 93 | 93 | 'type' => 'tools_import', |
| 94 | 94 | ), |
| 95 | 95 | array( |
| 96 | - 'name' => esc_html__( 'Import Docs Link', 'give' ), |
|
| 96 | + 'name' => esc_html__('Import Docs Link', 'give'), |
|
| 97 | 97 | 'id' => 'import_docs_link', |
| 98 | - 'url' => esc_url( 'http://docs.givewp.com/tools-importer' ), |
|
| 99 | - 'title' => __( 'Import Tab', 'give' ), |
|
| 98 | + 'url' => esc_url('http://docs.givewp.com/tools-importer'), |
|
| 99 | + 'title' => __('Import Tab', 'give'), |
|
| 100 | 100 | 'type' => 'give_docs_link', |
| 101 | 101 | ), |
| 102 | 102 | array( |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | * @param $field |
| 121 | 121 | * @param $option_value |
| 122 | 122 | */ |
| 123 | - public static function render_import_field( $field, $option_value ) { |
|
| 124 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-imports.php'; |
|
| 123 | + public static function render_import_field($field, $option_value) { |
|
| 124 | + include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-imports.php'; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * Admin View: Imports |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 6 | +if ( ! defined('ABSPATH')) { |
|
| 7 | 7 | exit; |
| 8 | 8 | } ?> |
| 9 | 9 | |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @since 1.8.14 |
| 20 | 20 | */ |
| 21 | - do_action( 'give_tools_tab_import_content_top' ); |
|
| 21 | + do_action('give_tools_tab_import_content_top'); |
|
| 22 | 22 | ?> |
| 23 | 23 | |
| 24 | 24 | <table class="widefat Import-options-table give-table"> |
| 25 | 25 | <thead> |
| 26 | 26 | <tr> |
| 27 | - <th scope="col"><?php esc_html_e( 'Import Type', 'give' ); ?></th> |
|
| 28 | - <th scope="col"><?php esc_html_e( 'Import Options', 'give' ); ?></th> |
|
| 27 | + <th scope="col"><?php esc_html_e('Import Type', 'give'); ?></th> |
|
| 28 | + <th scope="col"><?php esc_html_e('Import Options', 'give'); ?></th> |
|
| 29 | 29 | </tr> |
| 30 | 30 | </thead> |
| 31 | 31 | <tbody> |
@@ -38,19 +38,19 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @since 1.8.14 |
| 40 | 40 | */ |
| 41 | - do_action( 'give_tools_tab_import_table_top' ); |
|
| 41 | + do_action('give_tools_tab_import_table_top'); |
|
| 42 | 42 | ?> |
| 43 | 43 | |
| 44 | 44 | <tr class="give-Import-pdf-sales-earnings"> |
| 45 | 45 | <td scope="row" class="row-title"> |
| 46 | 46 | <h3> |
| 47 | - <span><?php esc_html_e( 'Import Donations', 'give' ); ?></span> |
|
| 47 | + <span><?php esc_html_e('Import Donations', 'give'); ?></span> |
|
| 48 | 48 | </h3> |
| 49 | - <p><?php esc_html_e( 'Import a CSV of Donations.', 'give' ); ?></p> |
|
| 49 | + <p><?php esc_html_e('Import a CSV of Donations.', 'give'); ?></p> |
|
| 50 | 50 | </td> |
| 51 | 51 | <td> |
| 52 | - <a class="button" href="<?php echo add_query_arg( array( 'importer-type' => 'import_donations' ) ); ?>"> |
|
| 53 | - <?php esc_html_e( 'Import CSV', 'give' ); ?> |
|
| 52 | + <a class="button" href="<?php echo add_query_arg(array('importer-type' => 'import_donations')); ?>"> |
|
| 53 | + <?php esc_html_e('Import CSV', 'give'); ?> |
|
| 54 | 54 | </a> |
| 55 | 55 | </td> |
| 56 | 56 | </tr> |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | <tr class="give-import-core-settings"> |
| 59 | 59 | <td scope="row" class="row-title"> |
| 60 | 60 | <h3> |
| 61 | - <span><?php esc_html_e( 'Import Give Settings', 'give' ); ?></span> |
|
| 61 | + <span><?php esc_html_e('Import Give Settings', 'give'); ?></span> |
|
| 62 | 62 | </h3> |
| 63 | - <p><?php esc_html_e( 'Import Give\'s settings in JSON format.', 'give' ); ?></p> |
|
| 63 | + <p><?php esc_html_e('Import Give\'s settings in JSON format.', 'give'); ?></p> |
|
| 64 | 64 | </td> |
| 65 | 65 | <td> |
| 66 | - <a class="button" href="<?php echo add_query_arg( array( 'importer-type' => 'import_core_setting' ) ); ?>"> |
|
| 67 | - <?php esc_html_e( 'Import JSON', 'give' ); ?> |
|
| 66 | + <a class="button" href="<?php echo add_query_arg(array('importer-type' => 'import_core_setting')); ?>"> |
|
| 67 | + <?php esc_html_e('Import JSON', 'give'); ?> |
|
| 68 | 68 | </a> |
| 69 | 69 | </td> |
| 70 | 70 | </tr> |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @since 1.8.14 |
| 80 | 80 | */ |
| 81 | - do_action( 'give_tools_tab_import_table_bottom' ); |
|
| 81 | + do_action('give_tools_tab_import_table_bottom'); |
|
| 82 | 82 | ?> |
| 83 | 83 | </tbody> |
| 84 | 84 | </table> |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * |
| 90 | 90 | * @since 1.8.14 |
| 91 | 91 | */ |
| 92 | - do_action( 'give_tools_tab_import_content_bottom' ); |
|
| 92 | + do_action('give_tools_tab_import_content_bottom'); |
|
| 93 | 93 | ?> |
| 94 | 94 | |
| 95 | 95 | </div> |
@@ -3,11 +3,11 @@ discard block |
||
| 3 | 3 | * Admin View: Import Core Settings |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 6 | +if ( ! defined('ABSPATH')) { |
|
| 7 | 7 | exit; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
| 10 | +if ( ! current_user_can('manage_give_settings')) { |
|
| 11 | 11 | return; |
| 12 | 12 | } |
| 13 | 13 | |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @since 1.8.17 |
| 18 | 18 | */ |
| 19 | -do_action( 'give_tools_import_core_settings_main_before' ); |
|
| 19 | +do_action('give_tools_import_core_settings_main_before'); |
|
| 20 | 20 | ?> |
| 21 | 21 | <div id="poststuff"> |
| 22 | 22 | <div class="postbox"> |
| 23 | - <h1 class="give-importer-h1" align="center"><?php esc_html_e( 'Import Settings', 'give' ); ?></h1> |
|
| 23 | + <h1 class="give-importer-h1" align="center"><?php esc_html_e('Import Settings', 'give'); ?></h1> |
|
| 24 | 24 | <div class="inside give-tools-setting-page-import give-import-core-settings"> |
| 25 | 25 | <?php |
| 26 | 26 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @since 1.8.17 |
| 30 | 30 | */ |
| 31 | - do_action( 'give_tools_import_core_settings_form_before_start' ); |
|
| 31 | + do_action('give_tools_import_core_settings_form_before_start'); |
|
| 32 | 32 | ?> |
| 33 | 33 | <form method="post" id="give-import-core-settings-form" |
| 34 | 34 | class="give-import-form tools-setting-page-import tools-setting-page-import" |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @since 1.8.17 |
| 42 | 42 | */ |
| 43 | - do_action( 'give_tools_import_core_settings_form_start' ); |
|
| 43 | + do_action('give_tools_import_core_settings_form_start'); |
|
| 44 | 44 | ?> |
| 45 | 45 | |
| 46 | 46 | <?php |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @since 1.8.17 |
| 51 | 51 | */ |
| 52 | - do_action( 'give_tools_import_core_settings_form_end' ); |
|
| 52 | + do_action('give_tools_import_core_settings_form_end'); |
|
| 53 | 53 | ?> |
| 54 | 54 | </form> |
| 55 | 55 | <?php |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @since 1.8.17 |
| 60 | 60 | */ |
| 61 | - do_action( 'give_tools_import_core_settings_form_after_end' ); |
|
| 61 | + do_action('give_tools_import_core_settings_form_after_end'); |
|
| 62 | 62 | ?> |
| 63 | 63 | </div><!-- .inside --> |
| 64 | 64 | </div><!-- .postbox --> |
@@ -69,4 +69,4 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @since 1.8.17 |
| 71 | 71 | */ |
| 72 | -do_action( 'give_tools_import_core_settings_main_after' ); |
|
| 72 | +do_action('give_tools_import_core_settings_main_after'); |
|
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 12 | +if ( ! defined('ABSPATH')) { |
|
| 13 | 13 | exit; // Exit if accessed directly |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! class_exists( 'Give_Settings_System_Info' ) ) : |
|
| 16 | +if ( ! class_exists('Give_Settings_System_Info')) : |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Give_Settings_System_Info. |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct() { |
| 36 | 36 | $this->id = 'system-info'; |
| 37 | - $this->label = esc_html__( 'System Info', 'give' ); |
|
| 37 | + $this->label = esc_html__('System Info', 'give'); |
|
| 38 | 38 | |
| 39 | 39 | parent::__construct(); |
| 40 | 40 | |
| 41 | 41 | // Do not use main form for this tab. |
| 42 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
| 43 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
| 44 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
| 42 | + if (give_get_current_setting_tab() === $this->id) { |
|
| 43 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
| 44 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function output() { |
| 55 | 55 | $GLOBALS['give_hide_save_button'] = true; |
| 56 | - include_once( 'views/html-admin-page-system-info.php' ); |
|
| 56 | + include_once('views/html-admin-page-system-info.php'); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // Load WP_List_Table if not loaded |
| 18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
| 19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
| 18 | +if ( ! class_exists('WP_List_Table')) { |
|
| 19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | global $status, $page; |
| 46 | 46 | |
| 47 | 47 | // Set parent defaults |
| 48 | - parent::__construct( array( |
|
| 49 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
| 50 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
| 48 | + parent::__construct(array( |
|
| 49 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
| 50 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
| 51 | 51 | 'ajax' => false // Does this table support ajax? |
| 52 | - ) ); |
|
| 52 | + )); |
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return string Column Name |
| 66 | 66 | */ |
| 67 | - public function column_default( $item, $column_name ) { |
|
| 68 | - $donation_list_page_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); |
|
| 67 | + public function column_default($item, $column_name) { |
|
| 68 | + $donation_list_page_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); |
|
| 69 | 69 | |
| 70 | - switch ( $column_name ) { |
|
| 70 | + switch ($column_name) { |
|
| 71 | 71 | case 'complete_sales': |
| 72 | - $value = $item[ $column_name ] ? |
|
| 72 | + $value = $item[$column_name] ? |
|
| 73 | 73 | sprintf( |
| 74 | 74 | '<a href="%s">%s</a>', |
| 75 | 75 | add_query_arg( |
@@ -79,13 +79,12 @@ discard block |
||
| 79 | 79 | ), |
| 80 | 80 | $donation_list_page_url |
| 81 | 81 | ), |
| 82 | - $item[ $column_name ] |
|
| 83 | - ) : |
|
| 84 | - $item[ $column_name ]; |
|
| 82 | + $item[$column_name] |
|
| 83 | + ) : $item[$column_name]; |
|
| 85 | 84 | break; |
| 86 | 85 | |
| 87 | 86 | case 'pending_sales': |
| 88 | - $value = $item[ $column_name ] ? |
|
| 87 | + $value = $item[$column_name] ? |
|
| 89 | 88 | sprintf( |
| 90 | 89 | '<a href="%s">%s</a>', |
| 91 | 90 | add_query_arg( |
@@ -95,13 +94,12 @@ discard block |
||
| 95 | 94 | ), |
| 96 | 95 | $donation_list_page_url |
| 97 | 96 | ), |
| 98 | - $item[ $column_name ] |
|
| 99 | - ) : |
|
| 100 | - $item[ $column_name ]; |
|
| 97 | + $item[$column_name] |
|
| 98 | + ) : $item[$column_name]; |
|
| 101 | 99 | break; |
| 102 | 100 | |
| 103 | 101 | case 'total_sales': |
| 104 | - $value = $item[ $column_name ] ? |
|
| 102 | + $value = $item[$column_name] ? |
|
| 105 | 103 | sprintf( |
| 106 | 104 | '<a href="%s">%s</a>', |
| 107 | 105 | add_query_arg( |
@@ -110,14 +108,13 @@ discard block |
||
| 110 | 108 | ), |
| 111 | 109 | $donation_list_page_url |
| 112 | 110 | ), |
| 113 | - $item[ $column_name ] |
|
| 114 | - ) : |
|
| 115 | - $item[ $column_name ]; |
|
| 111 | + $item[$column_name] |
|
| 112 | + ) : $item[$column_name]; |
|
| 116 | 113 | |
| 117 | 114 | break; |
| 118 | 115 | |
| 119 | 116 | default: |
| 120 | - $value = $item[ $column_name ]; |
|
| 117 | + $value = $item[$column_name]; |
|
| 121 | 118 | } |
| 122 | 119 | |
| 123 | 120 | return $value; |
@@ -132,11 +129,11 @@ discard block |
||
| 132 | 129 | */ |
| 133 | 130 | public function get_columns() { |
| 134 | 131 | $columns = array( |
| 135 | - 'label' => esc_attr__( 'Gateway', 'give' ), |
|
| 136 | - 'complete_sales' => esc_attr__( 'Complete Payments', 'give' ), |
|
| 137 | - 'pending_sales' => esc_attr__( 'Pending / Failed Payments', 'give' ), |
|
| 138 | - 'total_sales' => esc_attr__( 'Total Payments', 'give' ), |
|
| 139 | - 'total_donations' => esc_attr__( 'Total Donated', 'give' ) |
|
| 132 | + 'label' => esc_attr__('Gateway', 'give'), |
|
| 133 | + 'complete_sales' => esc_attr__('Complete Payments', 'give'), |
|
| 134 | + 'pending_sales' => esc_attr__('Pending / Failed Payments', 'give'), |
|
| 135 | + 'total_sales' => esc_attr__('Total Payments', 'give'), |
|
| 136 | + 'total_donations' => esc_attr__('Total Donated', 'give') |
|
| 140 | 137 | ); |
| 141 | 138 | |
| 142 | 139 | return $columns; |
@@ -151,7 +148,7 @@ discard block |
||
| 151 | 148 | */ |
| 152 | 149 | public function get_sortable_columns() { |
| 153 | 150 | return array( |
| 154 | - 'total_donations' => array( 'total_donations', false ) |
|
| 151 | + 'total_donations' => array('total_donations', false) |
|
| 155 | 152 | ); |
| 156 | 153 | } |
| 157 | 154 | |
@@ -164,7 +161,7 @@ discard block |
||
| 164 | 161 | * @return int Current page number |
| 165 | 162 | */ |
| 166 | 163 | public function get_paged() { |
| 167 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
| 164 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
| 168 | 165 | } |
| 169 | 166 | |
| 170 | 167 | |
@@ -175,7 +172,7 @@ discard block |
||
| 175 | 172 | * @since 1.0 |
| 176 | 173 | * @return void |
| 177 | 174 | */ |
| 178 | - public function bulk_actions( $which = '' ) { |
|
| 175 | + public function bulk_actions($which = '') { |
|
| 179 | 176 | |
| 180 | 177 | } |
| 181 | 178 | |
@@ -187,27 +184,27 @@ discard block |
||
| 187 | 184 | * |
| 188 | 185 | * @param string $which |
| 189 | 186 | */ |
| 190 | - protected function display_tablenav( $which ) { |
|
| 187 | + protected function display_tablenav($which) { |
|
| 191 | 188 | |
| 192 | - if ( 'top' === $which ) { |
|
| 193 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
| 189 | + if ('top' === $which) { |
|
| 190 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
| 194 | 191 | } |
| 195 | 192 | ?> |
| 196 | - <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
| 193 | + <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
| 197 | 194 | |
| 198 | - <?php if ( 'top' === $which ) { ?> |
|
| 195 | + <?php if ('top' === $which) { ?> |
|
| 199 | 196 | <h2 class="alignleft reports-earnings-title screen-reader-text"> |
| 200 | - <?php _e( 'Donation Methods Report', 'give' ); ?> |
|
| 197 | + <?php _e('Donation Methods Report', 'give'); ?> |
|
| 201 | 198 | </h2> |
| 202 | 199 | <?php } ?> |
| 203 | 200 | |
| 204 | 201 | <div class="alignright tablenav-right"> |
| 205 | 202 | <div class="actions bulkactions"> |
| 206 | - <?php $this->bulk_actions( $which ); ?> |
|
| 203 | + <?php $this->bulk_actions($which); ?> |
|
| 207 | 204 | </div> |
| 208 | 205 | <?php |
| 209 | - $this->extra_tablenav( $which ); |
|
| 210 | - $this->pagination( $which ); |
|
| 206 | + $this->extra_tablenav($which); |
|
| 207 | + $this->pagination($which); |
|
| 211 | 208 | ?> |
| 212 | 209 | </div> |
| 213 | 210 | |
@@ -229,17 +226,17 @@ discard block |
||
| 229 | 226 | * |
| 230 | 227 | * @return int |
| 231 | 228 | */ |
| 232 | - public function give_sort_total_donations( $old_value, $new_value ) { |
|
| 229 | + public function give_sort_total_donations($old_value, $new_value) { |
|
| 233 | 230 | // If no sort, default to label. |
| 234 | - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'label'; |
|
| 231 | + $orderby = ( ! empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'label'; |
|
| 235 | 232 | |
| 236 | 233 | //If no order, default to asc. |
| 237 | - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc'; |
|
| 234 | + $order = ( ! empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; |
|
| 238 | 235 | |
| 239 | 236 | //Determine sort order. |
| 240 | - $result = strcmp( $old_value[ $orderby ], $new_value[ $orderby ] ); |
|
| 237 | + $result = strcmp($old_value[$orderby], $new_value[$orderby]); |
|
| 241 | 238 | |
| 242 | - return ( $order === 'asc' ) ? $result : -$result; |
|
| 239 | + return ($order === 'asc') ? $result : -$result; |
|
| 243 | 240 | } |
| 244 | 241 | |
| 245 | 242 | |
@@ -256,10 +253,10 @@ discard block |
||
| 256 | 253 | $gateways = give_get_payment_gateways(); |
| 257 | 254 | $stats = new Give_Payment_Stats(); |
| 258 | 255 | |
| 259 | - foreach ( $gateways as $gateway_id => $gateway ) { |
|
| 256 | + foreach ($gateways as $gateway_id => $gateway) { |
|
| 260 | 257 | |
| 261 | - $complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' ); |
|
| 262 | - $pending_count = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) ); |
|
| 258 | + $complete_count = give_count_sales_by_gateway($gateway_id, 'publish'); |
|
| 259 | + $pending_count = give_count_sales_by_gateway($gateway_id, array('pending', 'failed')); |
|
| 263 | 260 | |
| 264 | 261 | $reports_data[] = array( |
| 265 | 262 | 'ID' => $gateway_id, |
@@ -267,7 +264,7 @@ discard block |
||
| 267 | 264 | 'complete_sales' => $complete_count, |
| 268 | 265 | 'pending_sales' => $pending_count, |
| 269 | 266 | 'total_sales' => $complete_count + $pending_count, |
| 270 | - 'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, strtotime('04/13/2015' ), current_time('timestamp' ), $gateway_id ), array( 'sanitize' => false ) ) ), |
|
| 267 | + 'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, strtotime('04/13/2015'), current_time('timestamp'), $gateway_id), array('sanitize' => false))), |
|
| 271 | 268 | ); |
| 272 | 269 | } |
| 273 | 270 | |
@@ -288,11 +285,11 @@ discard block |
||
| 288 | 285 | $columns = $this->get_columns(); |
| 289 | 286 | $hidden = array(); // No hidden columns |
| 290 | 287 | $sortable = $this->get_sortable_columns(); |
| 291 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
| 288 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
| 292 | 289 | $this->items = $this->reports_data(); |
| 293 | 290 | |
| 294 | 291 | // Sort Array when we are sorting data in array. |
| 295 | - usort( $this->items, array( $this, 'give_sort_total_donations' ) ); |
|
| 292 | + usort($this->items, array($this, 'give_sort_total_donations')); |
|
| 296 | 293 | |
| 297 | 294 | } |
| 298 | 295 | } |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | ?> |
| 17 | 17 | <div class="wrap" id="poststuff"> |
| 18 | 18 | <div id="give-updates"> |
| 19 | - <h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates Complete', 'give' ); ?></h1> |
|
| 19 | + <h1 id="give-updates-h1"><?php esc_html_e('Give - Updates Complete', 'give'); ?></h1> |
|
| 20 | 20 | <hr class="wp-header-end"> |
| 21 | 21 | |
| 22 | 22 | <div class="give-update-panel-content"> |
| 23 | - <p><?php esc_html_e( 'Congratulations! You are running the latest versions of Give and its add-ons.', 'give' ); ?></p> |
|
| 23 | + <p><?php esc_html_e('Congratulations! You are running the latest versions of Give and its add-ons.', 'give'); ?></p> |
|
| 24 | 24 | </div> |
| 25 | 25 | |
| 26 | 26 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly. |
| 15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 15 | +if ( ! defined('ABSPATH')) { |
|
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | give_ignore_user_abort(); |
| 42 | 42 | |
| 43 | 43 | nocache_headers(); |
| 44 | - header( 'Content-Type: text/csv; charset=utf-8' ); |
|
| 45 | - header( 'Content-Disposition: attachment; filename=' . apply_filters( 'give_earnings_export_filename', 'give-export-' . $this->export_type . '-' . date( 'n' ) . '-' . date( 'Y' ) ) . '.csv' ); |
|
| 46 | - header( "Expires: 0" ); |
|
| 44 | + header('Content-Type: text/csv; charset=utf-8'); |
|
| 45 | + header('Content-Disposition: attachment; filename='.apply_filters('give_earnings_export_filename', 'give-export-'.$this->export_type.'-'.date('n').'-'.date('Y')).'.csv'); |
|
| 46 | + header("Expires: 0"); |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | public function csv_cols() { |
| 58 | 58 | |
| 59 | 59 | $cols = array( |
| 60 | - 'date' => __( 'Date', 'give' ), |
|
| 61 | - 'donations' => __( 'Donations', 'give' ), |
|
| 60 | + 'date' => __('Date', 'give'), |
|
| 61 | + 'donations' => __('Donations', 'give'), |
|
| 62 | 62 | /* translators: %s: currency */ |
| 63 | - 'earnings' => sprintf( __( 'Income (%s)', 'give' ), give_currency_symbol('', true) ) |
|
| 63 | + 'earnings' => sprintf(__('Income (%s)', 'give'), give_currency_symbol('', true)) |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | return $cols; |
@@ -75,28 +75,28 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function get_data() { |
| 77 | 77 | |
| 78 | - $start_year = isset( $_POST['start_year'] ) ? absint( $_POST['start_year'] ) : date( 'Y' ); |
|
| 79 | - $end_year = isset( $_POST['end_year'] ) ? absint( $_POST['end_year'] ) : date( 'Y' ); |
|
| 80 | - $start_month = isset( $_POST['start_month'] ) ? absint( $_POST['start_month'] ) : date( 'n' ); |
|
| 81 | - $end_month = isset( $_POST['end_month'] ) ? absint( $_POST['end_month'] ) : date( 'n' ); |
|
| 78 | + $start_year = isset($_POST['start_year']) ? absint($_POST['start_year']) : date('Y'); |
|
| 79 | + $end_year = isset($_POST['end_year']) ? absint($_POST['end_year']) : date('Y'); |
|
| 80 | + $start_month = isset($_POST['start_month']) ? absint($_POST['start_month']) : date('n'); |
|
| 81 | + $end_month = isset($_POST['end_month']) ? absint($_POST['end_month']) : date('n'); |
|
| 82 | 82 | |
| 83 | 83 | $data = array(); |
| 84 | 84 | $year = $start_year; |
| 85 | 85 | $stats = new Give_Payment_Stats; |
| 86 | 86 | |
| 87 | - while ( $year <= $end_year ) { |
|
| 87 | + while ($year <= $end_year) { |
|
| 88 | 88 | |
| 89 | - if ( $year == $start_year && $year == $end_year ) { |
|
| 89 | + if ($year == $start_year && $year == $end_year) { |
|
| 90 | 90 | |
| 91 | 91 | $m1 = $start_month; |
| 92 | 92 | $m2 = $end_month; |
| 93 | 93 | |
| 94 | - } elseif ( $year == $start_year ) { |
|
| 94 | + } elseif ($year == $start_year) { |
|
| 95 | 95 | |
| 96 | 96 | $m1 = $start_month; |
| 97 | 97 | $m2 = 12; |
| 98 | 98 | |
| 99 | - } elseif ( $year == $end_year ) { |
|
| 99 | + } elseif ($year == $end_year) { |
|
| 100 | 100 | |
| 101 | 101 | $m1 = 1; |
| 102 | 102 | $m2 = $end_month; |
@@ -108,28 +108,28 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - while ( $m1 <= $m2 ) { |
|
| 111 | + while ($m1 <= $m2) { |
|
| 112 | 112 | |
| 113 | - $date1 = mktime( 0, 0, 0, $m1, 1, $year ); |
|
| 114 | - $date2 = mktime( 0, 0, 0, $m1, cal_days_in_month( CAL_GREGORIAN, $m1, $year ), $year ); |
|
| 113 | + $date1 = mktime(0, 0, 0, $m1, 1, $year); |
|
| 114 | + $date2 = mktime(0, 0, 0, $m1, cal_days_in_month(CAL_GREGORIAN, $m1, $year), $year); |
|
| 115 | 115 | |
| 116 | 116 | $data[] = array( |
| 117 | - 'date' => date_i18n( 'F Y', $date1 ), |
|
| 118 | - 'donations' => $stats->get_sales( 0, $date1, $date2 ), |
|
| 119 | - 'earnings' => give_format_amount( $stats->get_earnings( 0, $date1, $date2 ), array( 'sanitize' => false ) ), |
|
| 117 | + 'date' => date_i18n('F Y', $date1), |
|
| 118 | + 'donations' => $stats->get_sales(0, $date1, $date2), |
|
| 119 | + 'earnings' => give_format_amount($stats->get_earnings(0, $date1, $date2), array('sanitize' => false)), |
|
| 120 | 120 | ); |
| 121 | 121 | |
| 122 | - $m1 ++; |
|
| 122 | + $m1++; |
|
| 123 | 123 | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | - $year ++; |
|
| 127 | + $year++; |
|
| 128 | 128 | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - $data = apply_filters( 'give_export_get_data', $data ); |
|
| 132 | - $data = apply_filters( "give_export_get_data_{$this->export_type}", $data ); |
|
| 131 | + $data = apply_filters('give_export_get_data', $data); |
|
| 132 | + $data = apply_filters("give_export_get_data_{$this->export_type}", $data); |
|
| 133 | 133 | |
| 134 | 134 | return $data; |
| 135 | 135 | } |