SportsPress – Sports Club & League Manager - Version 2.7.15

Version Description

  • Feature - Sports news widget in dashboard.
  • Fix - Fixture importer bug with extended characters in league and season name.
  • Fix - Player list not loading (too many resources).
  • Fix - Performance format not updating.
  • Fix - Trim whitespace on geo coordinates to avoid import error.
Download this release

Release Info

Developer ThemeBoy
Plugin Icon 128x128 SportsPress – Sports Club & League Manager
Version 2.7.15
Comparing to
See all releases

Code changes from version 2.7.13 to 2.7.15

changelog.txt CHANGED
@@ -1,5 +1,18 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.7.13 =
4
  * Fix - Theme notice escaping.
5
  * Fix - Timezone dropdown selection now shown in general settings.
1
  == SportsPress Changelog ==
2
 
3
+ = 2.7.15 =
4
+ * Feature - Sports news widget in dashboard.
5
+ * Fix - Fixture importer bug with extended characters in league and season name.
6
+ * Fix - Player list not loading (too many resources).
7
+ * Fix - Performance format not updating.
8
+ * Fix - Trim whitespace on geo coordinates to avoid import error.
9
+
10
+ = 2.7.14 =
11
+ * Fix - Error when non-value added as adjustment.
12
+ * Fix - Map links not escaped properly.
13
+ * Fix - Event blocks missing attributes.
14
+ * Fix - Player statistics meta escaping.
15
+
16
  = 2.7.13 =
17
  * Fix - Theme notice escaping.
18
  * Fix - Timezone dropdown selection now shown in general settings.
feeds/ical.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Feeds
7
  * @package SportsPress/Feeds
8
- * @version 2.7.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
5
  * @author ThemeBoy
6
  * @category Feeds
7
  * @package SportsPress/Feeds
8
+ * @version 2.7.15
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
includes/admin/class-sp-admin-dashboard.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.7.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
@@ -33,7 +33,7 @@ if ( ! class_exists( 'SP_Admin_Dashboard' ) ) :
33
  * Init dashboard widgets
34
  */
35
  public function init() {
36
- // wp_add_dashboard_widget( 'sportspress_dashboard_news', esc_attr__( 'Sports News', 'sportspress' ), array( $this, 'news_widget' ), null, null, 'side' );
37
  wp_add_dashboard_widget( 'sportspress_dashboard_status', esc_attr__( 'SportsPress', 'sportspress' ), array( $this, 'status_widget' ) );
38
  add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
39
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.7.15
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
33
  * Init dashboard widgets
34
  */
35
  public function init() {
36
+ wp_add_dashboard_widget( 'sportspress_dashboard_news', esc_attr__( 'Sports News', 'sportspress' ), array( $this, 'news_widget' ), null, null, 'side' );
37
  wp_add_dashboard_widget( 'sportspress_dashboard_status', esc_attr__( 'SportsPress', 'sportspress' ), array( $this, 'status_widget' ) );
38
  add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 );
39
  }
includes/admin/importers/class-sp-fixture-importer.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
- * @version 2.7.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
@@ -55,8 +55,8 @@ if ( class_exists( 'WP_Importer' ) ) {
55
 
56
  // Get event format, league, and season from post vars
57
  $event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) );
58
- $league = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_league'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
59
- $season = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : sanitize_key( $_POST['sp_season'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
60
  $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) );
61
 
62
  foreach ( $rows as $row ) :
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
+ * @version 2.7.15
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
55
 
56
  // Get event format, league, and season from post vars
57
  $event_format = ( empty( $_POST['sp_format'] ) ? false : sanitize_key( $_POST['sp_format'] ) );
58
+ $league = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : $_POST['sp_league'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
59
+ $season = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : $_POST['sp_season'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
60
  $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : sanitize_text_field( wp_unslash( $_POST['sp_date_format'] ) ) );
61
 
62
  foreach ( $rows as $row ) :
includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.7.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
@@ -197,7 +197,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
197
  self::delete_duplicate( $_POST );
198
  update_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '', 'text' ) );
199
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1, 'int' ) );
200
- update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number', 'int' ) );
201
  update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0, 'int' ) );
202
  update_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0, 'int' ) );
203
  update_post_meta( $post_id, 'sp_sendoff', sp_array_value( $_POST, 'sp_sendoff', 0, 'int' ) );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.7.15
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
197
  self::delete_duplicate( $_POST );
198
  update_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '', 'text' ) );
199
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1, 'int' ) );
200
+ update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number', 'text' ) );
201
  update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0, 'int' ) );
202
  update_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0, 'int' ) );
203
  update_post_meta( $post_id, 'sp_sendoff', sp_array_value( $_POST, 'sp_sendoff', 0, 'int' ) );
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.7.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
@@ -199,7 +199,19 @@ class SP_Meta_Box_Player_Statistics {
199
  if ( 0 === $div_id ) {
200
  esc_attr_e( 'Total', 'sportspress' );
201
  } elseif ( 'WP_Error' != get_class( $div ) ) {
202
- echo esc_attr( apply_filters( 'sportspress_meta_box_player_statistics_season_name', $div->name, $league_id, $div_id, $div_stats ) );
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
204
  ?>
205
  </label>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.7.14
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
199
  if ( 0 === $div_id ) {
200
  esc_attr_e( 'Total', 'sportspress' );
201
  } elseif ( 'WP_Error' != get_class( $div ) ) {
202
+ $allowed_html = array(
203
+ 'input' => array(
204
+ 'type' => array(),
205
+ 'class' => array(),
206
+ 'name' => array(),
207
+ 'value' => array(),
208
+ 'size' => array(),
209
+ 'placeholder' => array(),
210
+ 'id' => array(),
211
+ 'readonly' => array(),
212
+ ),
213
+ );
214
+ echo wp_kses( apply_filters( 'sportspress_meta_box_player_statistics_season_name', $div->name, $league_id, $div_id, $div_stats ), $allowed_html );
215
  }
216
  ?>
217
  </label>
includes/class-sp-player-list.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
- * @version 2.7.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -772,7 +772,7 @@ endif;
772
  $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision );
773
 
774
  // Adjustment
775
- $adjustment = sp_array_value( $player_adjustments, $stat->post_name, 0 );
776
 
777
  // Apply adjustment
778
  if ( $adjustment != 0 ) :
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
+ * @version 2.7.14
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
772
  $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision );
773
 
774
  // Adjustment
775
+ $adjustment = (float) sp_array_value( $player_adjustments, $stat->post_name, 0 );
776
 
777
  // Apply adjustment
778
  if ( $adjustment != 0 ) :
includes/sp-core-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.7.11
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -1923,15 +1923,24 @@ function sp_has_shortcodes( $content, $tags ) {
1923
  /**
1924
  * Check if a custom flag was uploaded from the user
1925
  *
1926
- * @return bool
1927
  */
1928
  function sp_flags( $nationality ) {
1929
  $nationality = strtolower( $nationality );
1930
  $flag = '';
1931
- global $wpdb;
1932
- $flag_post_id = intval( $wpdb->get_var( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '%/$nationality'" ) );
1933
- if ( $flag_post_id ) {
1934
- $flag_src = wp_get_attachment_image_url( $flag_post_id, array( 23, 15 ), false );
 
 
 
 
 
 
 
 
 
1935
  $flag = '<img src="' . $flag_src . '" alt="' . $nationality . '">';
1936
  } else {
1937
  $flag = '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . $nationality . '.png" alt="' . $nationality . '">';
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.7.15
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
1923
  /**
1924
  * Check if a custom flag was uploaded from the user
1925
  *
1926
+ * @return string
1927
  */
1928
  function sp_flags( $nationality ) {
1929
  $nationality = strtolower( $nationality );
1930
  $flag = '';
1931
+ $custom_flag_post_id = false;
1932
+ $args = array(
1933
+ 'post_type' => 'attachment',
1934
+ 'title' => $nationality,
1935
+ 'posts_per_page' => 1,
1936
+ 'fields' => 'ids',
1937
+ );
1938
+ $custom_flag = get_posts( $args );
1939
+ if( $custom_flag ){
1940
+ $custom_flag_post_id = $custom_flag[0];
1941
+ }
1942
+ if ( $custom_flag_post_id ) {
1943
+ $flag_src = wp_get_attachment_image_url( $custom_flag_post_id, array( 23, 15 ), false );
1944
  $flag = '<img src="' . $flag_src . '" alt="' . $nationality . '">';
1945
  } else {
1946
  $flag = '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . $nationality . '.png" alt="' . $nationality . '">';
license.txt CHANGED
@@ -1,6 +1,6 @@
1
  SportsPress
2
 
3
- Copyright 2021 by the contributors
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  SportsPress
2
 
3
+ Copyright 2022 by the contributors
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
modules/sportspress-openstreetmap.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Modules
7
  * @package SportsPress/Modules
8
- * @version 2.7.9
9
  */
10
 
11
  // Exit if accessed directly
@@ -19,7 +19,7 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ) :
19
  * Main SportsPress OpenStreetMap Class
20
  *
21
  * @class SportsPress_OpenStreetMap
22
- * @version 2.7.5
23
  */
24
 
25
  class SportsPress_OpenStreetMap {
@@ -47,7 +47,7 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ) :
47
  */
48
  private function define_constants() {
49
  if ( ! defined( 'SP_OPENSTREETMAP_VERSION' ) ) {
50
- define( 'SP_OPENSTREETMAP_VERSION', '2.7.5' );
51
  }
52
 
53
  if ( ! defined( 'SP_OPENSTREETMAP_URL' ) ) {
@@ -128,7 +128,7 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ) :
128
  $lon_sec = floor( $lon_sec - ( $lon_min * 60 ) );
129
  $lon_dir = $longitude > 0 ? 'E' : 'W';
130
  ?>
131
- <a href="https://www.google.com/maps/place/<?php echo esc_url( urlencode( "{$lat_deg}°{$lat_min}'{$lat_sec}\"{$lat_dir}" ) ) . '+' . esc_url( urlencode( "{$lon_deg}°{$lon_min}'{$lon_sec}\"{$lon_dir}" ) ); ?>/@<?php echo esc_url($latitude); ?>,<?php echo esc_url($longitude); ?>,<?php echo esc_url($zoom); ?>z" target="_blank"><div id="sp_openstreetmaps_container" style="width: 100%; height: 320px"></div></a>
132
  <script>
133
  // position we will use later
134
  var lat = <?php echo esc_attr( $latitude ); ?>;
5
  * @author ThemeBoy
6
  * @category Modules
7
  * @package SportsPress/Modules
8
+ * @version 2.7.14
9
  */
10
 
11
  // Exit if accessed directly
19
  * Main SportsPress OpenStreetMap Class
20
  *
21
  * @class SportsPress_OpenStreetMap
22
+ * @version 2.7.14
23
  */
24
 
25
  class SportsPress_OpenStreetMap {
47
  */
48
  private function define_constants() {
49
  if ( ! defined( 'SP_OPENSTREETMAP_VERSION' ) ) {
50
+ define( 'SP_OPENSTREETMAP_VERSION', '2.7.14' );
51
  }
52
 
53
  if ( ! defined( 'SP_OPENSTREETMAP_URL' ) ) {
128
  $lon_sec = floor( $lon_sec - ( $lon_min * 60 ) );
129
  $lon_dir = $longitude > 0 ? 'E' : 'W';
130
  ?>
131
+ <a href="<?php echo esc_url( 'https://www.google.com/maps/place/' . urlencode( "{$lat_deg}°{$lat_min}'{$lat_sec}\"{$lat_dir}" ) . '+' . urlencode( "{$lon_deg}°{$lon_min}'{$lon_sec}\"{$lon_dir}" ) . '/@' . $latitude . ',' . $longitude . ',' . $zoom . 'z' ); ?>" target="_blank"><div id="sp_openstreetmaps_container" style="width: 100%; height: 320px"></div></a>
132
  <script>
133
  // position we will use later
134
  var lat = <?php echo esc_attr( $latitude ); ?>;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochester
3
  Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
- Tested up to: 5.8.1
7
- Stable tag: 2.7.13
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -240,6 +240,19 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
240
 
241
  == Changelog ==
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  = 2.7.13 =
244
  * Fix - Theme notice escaping.
245
  * Fix - Timezone dropdown selection now shown in general settings.
3
  Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
+ Tested up to: 6.1
7
+ Stable tag: 2.7.15
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
240
 
241
  == Changelog ==
242
 
243
+ = 2.7.15 =
244
+ * Feature - Sports news widget in dashboard.
245
+ * Fix - Fixture importer bug with extended characters in league and season name.
246
+ * Fix - Player list not loading (too many resources).
247
+ * Fix - Performance format not updating.
248
+ * Fix - Trim whitespace on geo coordinates to avoid import error.
249
+
250
+ = 2.7.14 =
251
+ * Fix - Error when non-value added as adjustment.
252
+ * Fix - Map links not escaped properly.
253
+ * Fix - Event blocks missing attributes.
254
+ * Fix - Player statistics meta escaping.
255
+
256
  = 2.7.13 =
257
  * Fix - Theme notice escaping.
258
  * Fix - Timezone dropdown selection now shown in general settings.
sportspress.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
- * Version: 2.7.13
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
- * Tested up to: 5.8.1
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.7.13
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.7.13';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
+ * Version: 2.7.15
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
+ * Tested up to: 6.1
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.7.15
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.7.15';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
templates/event-fixtures-results.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
@@ -96,17 +96,17 @@ $results = ob_get_clean();
96
 
97
  if ( false == $fixtures || false == $results ) {
98
 
99
- echo wp_kses_post( $fixtures );
100
- echo wp_kses_post( $results );
101
 
102
  } else {
103
 
104
  echo '<div class="sp-widget-align-left">';
105
- echo wp_kses_post( $fixtures );
106
  echo '</div>';
107
 
108
  echo '<div class="sp-widget-align-right">';
109
- echo wp_kses_post( $results );
110
  echo '</div>';
111
  }
112
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.7.14
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
96
 
97
  if ( false == $fixtures || false == $results ) {
98
 
99
+ echo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
100
+ echo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
101
 
102
  } else {
103
 
104
  echo '<div class="sp-widget-align-left">';
105
+ echo $fixtures; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
106
  echo '</div>';
107
 
108
  echo '<div class="sp-widget-align-right">';
109
+ echo $results; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
110
  echo '</div>';
111
  }
112