Changeset 3435015
- Timestamp:
- 01/08/2026 10:16:00 AM (6 weeks ago)
- Location:
- hizzle-downloads
- Files:
-
- 2 added
- 8 deleted
- 16 edited
- 1 copied
-
tags/1.2.7 (copied) (copied from hizzle-downloads/trunk)
-
tags/1.2.7/hizzle-downloads.php (modified) (2 diffs)
-
tags/1.2.7/readme.txt (modified) (2 diffs)
-
tags/1.2.7/vendor/composer/installed.json (modified) (3 diffs)
-
tags/1.2.7/vendor/composer/installed.php (modified) (3 diffs)
-
tags/1.2.7/vendor/hizzle/store/JOINS.md (deleted)
-
tags/1.2.7/vendor/hizzle/store/example-plugin.php (deleted)
-
tags/1.2.7/vendor/hizzle/store/index.php (deleted)
-
tags/1.2.7/vendor/hizzle/store/src/Collection.php (modified) (1 diff)
-
tags/1.2.7/vendor/hizzle/store/src/Main.php (added)
-
tags/1.2.7/vendor/hizzle/store/src/Query.php (modified) (3 diffs)
-
tags/1.2.7/vendor/hizzle/store/src/REST_Controller.php (modified) (1 diff)
-
tags/1.2.7/vendor/hizzle/store/src/Store.php (modified) (4 diffs)
-
tags/1.2.7/vendor/hizzle/store/src/index.php (deleted)
-
trunk/hizzle-downloads.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/composer/installed.json (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
-
trunk/vendor/hizzle/store/JOINS.md (deleted)
-
trunk/vendor/hizzle/store/example-plugin.php (deleted)
-
trunk/vendor/hizzle/store/index.php (deleted)
-
trunk/vendor/hizzle/store/src/Collection.php (modified) (1 diff)
-
trunk/vendor/hizzle/store/src/Main.php (added)
-
trunk/vendor/hizzle/store/src/Query.php (modified) (3 diffs)
-
trunk/vendor/hizzle/store/src/REST_Controller.php (modified) (1 diff)
-
trunk/vendor/hizzle/store/src/Store.php (modified) (4 diffs)
-
trunk/vendor/hizzle/store/src/index.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
hizzle-downloads/tags/1.2.7/hizzle-downloads.php
r3424134 r3435015 4 4 * Plugin URI: https://hizzle.co/download-manager/ 5 5 * Description: A lightweight download manager plugin. 6 * Version: 1.2. 66 * Version: 1.2.7 7 7 * Author: Hizzle 8 8 * Author URI: https://hizzle.co … … 22 22 23 23 if ( ! defined( 'HIZZLE_DOWNLOADS_VERSION' ) ) { 24 define( 'HIZZLE_DOWNLOADS_VERSION', '1.2. 6' );24 define( 'HIZZLE_DOWNLOADS_VERSION', '1.2.7' ); 25 25 } 26 26 -
hizzle-downloads/tags/1.2.7/readme.txt
r3424134 r3435015 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6 7 Version: 1.2. 68 Stable tag: 1.2. 67 Version: 1.2.7 8 Stable tag: 1.2.7 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 132 132 == Changelog == 133 133 134 = 1.2.7 = 135 - Update composer packages. 136 134 137 = 1.2.6 = 135 138 - Perfomance improvements. -
hizzle-downloads/tags/1.2.7/vendor/composer/installed.json
r3420634 r3435015 54 54 { 55 55 "name": "hizzle/store", 56 "version": "0.2.1 5",57 "version_normalized": "0.2.1 5.0",56 "version": "0.2.17", 57 "version_normalized": "0.2.17.0", 58 58 "source": { 59 59 "type": "git", 60 60 "url": "https://github.com/hizzle-co/datastore.git", 61 "reference": " 683cf2462478fc54939de9bdcb0e49e8d42ef631"61 "reference": "1b867f0c029c87431ccfb9c76821f868d1d63875" 62 62 }, 63 63 "dist": { 64 64 "type": "zip", 65 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/ 683cf2462478fc54939de9bdcb0e49e8d42ef631",66 "reference": " 683cf2462478fc54939de9bdcb0e49e8d42ef631",65 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/1b867f0c029c87431ccfb9c76821f868d1d63875", 66 "reference": "1b867f0c029c87431ccfb9c76821f868d1d63875", 67 67 "shasum": "" 68 68 }, … … 70 70 "php": ">=5.3.0" 71 71 }, 72 "time": "202 5-11-06T07:39:20+00:00",72 "time": "2026-01-08T09:55:37+00:00", 73 73 "type": "library", 74 74 "installation-source": "dist", … … 99 99 "support": { 100 100 "issues": "https://github.com/hizzle-co/datastore/issues", 101 "source": "https://github.com/hizzle-co/datastore/tree/0.2.1 5"101 "source": "https://github.com/hizzle-co/datastore/tree/0.2.17" 102 102 }, 103 103 "install-path": "../hizzle/store" -
hizzle-downloads/tags/1.2.7/vendor/composer/installed.php
r3424134 r3435015 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 0450caee14fe401d9beed36f42a0b086d7fd7140',6 'reference' => 'dfebdbe0fa191a0a76e5e45e018f0fd6f59ac1dd', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 0450caee14fe401d9beed36f42a0b086d7fd7140',16 'reference' => 'dfebdbe0fa191a0a76e5e45e018f0fd6f59ac1dd', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'hizzle/store' => array( 32 'pretty_version' => '0.2.1 5',33 'version' => '0.2.1 5.0',34 'reference' => ' 683cf2462478fc54939de9bdcb0e49e8d42ef631',32 'pretty_version' => '0.2.17', 33 'version' => '0.2.17.0', 34 'reference' => '1b867f0c029c87431ccfb9c76821f868d1d63875', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../hizzle/store', -
hizzle-downloads/tags/1.2.7/vendor/hizzle/store/src/Collection.php
r3420634 r3435015 626 626 'default' => 25, 627 627 'minimum' => -1, 628 'maximum' => 100 ,628 'maximum' => 1000, 629 629 'sanitize_callback' => __CLASS__ . '::intval', 630 630 'validate_callback' => 'rest_validate_request_arg', -
hizzle-downloads/tags/1.2.7/vendor/hizzle/store/src/Query.php
r3389422 r3435015 343 343 $offset = get_option( 'gmt_offset', 0 ); 344 344 345 // Ensure offset is a float 346 $offset = floatval( $offset ); 347 348 // Get the absolute value of the offset 349 $abs_offset = abs( $offset ); 350 351 // Calculate hours and minutes 352 $hours = floor( $abs_offset ); 353 $minutes = ( $abs_offset - $hours ) * 60; 354 355 // Format the offset string 356 $offset_string = sprintf( 357 '%s%02d:%02d', 358 $offset >= 0 ? '+' : '-', 359 $hours, 360 $minutes 361 ); 362 363 return $offset_string; 345 // Ensure offset is a float in minutes 346 $offset = floatval( $offset ) * 60; 347 348 if ( 0 > $offset ) { 349 return "DATE_SUB(%s, INTERVAL $offset MINUTE)"; 350 } 351 352 if ( 0 < $offset ) { 353 $offset = abs( $offset ); 354 return "DATE_ADD(%s, INTERVAL $offset MINUTE)"; 355 } 356 357 // If zero offset, return UTC 358 return '%s'; 364 359 } 365 360 … … 459 454 460 455 // Prepare groupby fields. 461 $timezone = esc_sql( $this->get_mysql_timezone_offset());456 $timezone_offset = $this->get_mysql_timezone_offset(); 462 457 if ( ! empty( $qv['groupby'] ) ) { 463 458 foreach ( wp_parse_list( $qv['groupby'] ) as $index => $field ) { … … 485 480 // Handle casting and timezone conversion 486 481 if ( $cast ) { 482 // Append cast_ prefix to avoid confusion 483 $field = 'cast_' . $field; 484 485 // Group by date parts with timezone conversion. 486 $local_time_table_field = sprintf( $timezone_offset, $table_field ); 487 487 switch ( $cast ) { 488 488 case 'hour': 489 $table_field = "DATE_FORMAT( CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-%m-%d %H:00:00')";489 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-%m-%d %H:00:00')"; 490 490 break; 491 491 case 'day': 492 $table_field = "DATE( CONVERT_TZ($table_field, '+00:00', '$timezone'))";492 $table_field = "DATE($local_time_table_field)"; 493 493 break; 494 494 case 'week': 495 $table_field = "DATE(DATE_SUB(CONVERT_TZ($table_field, '+00:00', '$timezone'), INTERVAL WEEKDAY(CONVERT_TZ($table_field, '+00:00', '$timezone')) DAY))"; 495 // Normalize the date to the Monday of the same week 496 // WEEKDAY($local_time_table_field) returns a number from 0 to 6, where Monday is 0 and Sunday is 6. 497 // This tells us how many days have passed since Monday for that date. 498 // DATE_SUB($local_time_table_field, INTERVAL WEEKDAY($local_time_table_field) DAY) subtracts that many days from the original date. 499 // The result is the Monday of the week that $local_time_table_field falls in. 500 // DATE(...) then strips off any time component and returns just the date. 501 $table_field = "DATE(DATE_SUB($local_time_table_field, INTERVAL WEEKDAY($local_time_table_field) DAY))"; 496 502 break; 497 503 case 'month': 498 $table_field = "DATE_FORMAT( CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-%m-01')";504 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-%m-01')"; 499 505 break; 500 506 case 'year': 501 $table_field = "DATE_FORMAT(CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-01-01')"; 507 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-01-01')"; 508 break; 509 case 'day_of_week': 510 // WEEKDAY(date) returns an integer from 0 to 6, where: 511 // 0 === Monday and 6 === Sunday 512 $table_field = "WEEKDAY($local_time_table_field)"; 502 513 break; 503 514 default: -
hizzle-downloads/tags/1.2.7/vendor/hizzle/store/src/REST_Controller.php
r3420634 r3435015 615 615 $paged = (int) $query->query_vars['page']; 616 616 617 $max_pages = $total > 0 && $per_page > 1? ceil( $total / $per_page ) : 1;617 $max_pages = $total > 0 && $per_page > 0 ? ceil( $total / $per_page ) : 1; 618 618 619 619 $response = rest_ensure_response( -
hizzle-downloads/tags/1.2.7/vendor/hizzle/store/src/Store.php
r3245426 r3435015 56 56 // Prepare the collections. 57 57 foreach ( $this->collections as $key => $collection ) { 58 if ( ! $collection instanceof Collection ) {59 $collection['name'] = $key;60 $this->collections[ $key ] = new Collection( $this->namespace, $collection );61 }62 }58 if ( ! $collection instanceof Collection ) { 59 $collection['name'] = $key; 60 $this->collections[ $key ] = new Collection( $this->namespace, $collection ); 61 } 62 } 63 63 64 64 // Register the store. … … 90 90 self::$instances[ $namespace ]->collections[ $key ] = $collections[ $key ]; 91 91 } 92 }92 } 93 93 94 94 return self::$instances[ $namespace ]; … … 150 150 151 151 /** 152 * Returns the table definitions as an array.153 *154 * @return string[]155 */156 public function get_schema() {152 * Returns the table definitions as an array. 153 * 154 * @return string[] 155 */ 156 public function get_schema() { 157 157 $schema = array(); 158 158 … … 164 164 return array_filter( $schema ); 165 165 } 166 167 166 } -
hizzle-downloads/trunk/hizzle-downloads.php
r3424134 r3435015 4 4 * Plugin URI: https://hizzle.co/download-manager/ 5 5 * Description: A lightweight download manager plugin. 6 * Version: 1.2. 66 * Version: 1.2.7 7 7 * Author: Hizzle 8 8 * Author URI: https://hizzle.co … … 22 22 23 23 if ( ! defined( 'HIZZLE_DOWNLOADS_VERSION' ) ) { 24 define( 'HIZZLE_DOWNLOADS_VERSION', '1.2. 6' );24 define( 'HIZZLE_DOWNLOADS_VERSION', '1.2.7' ); 25 25 } 26 26 -
hizzle-downloads/trunk/readme.txt
r3424134 r3435015 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6 7 Version: 1.2. 68 Stable tag: 1.2. 67 Version: 1.2.7 8 Stable tag: 1.2.7 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 132 132 == Changelog == 133 133 134 = 1.2.7 = 135 - Update composer packages. 136 134 137 = 1.2.6 = 135 138 - Perfomance improvements. -
hizzle-downloads/trunk/vendor/composer/installed.json
r3420634 r3435015 54 54 { 55 55 "name": "hizzle/store", 56 "version": "0.2.1 5",57 "version_normalized": "0.2.1 5.0",56 "version": "0.2.17", 57 "version_normalized": "0.2.17.0", 58 58 "source": { 59 59 "type": "git", 60 60 "url": "https://github.com/hizzle-co/datastore.git", 61 "reference": " 683cf2462478fc54939de9bdcb0e49e8d42ef631"61 "reference": "1b867f0c029c87431ccfb9c76821f868d1d63875" 62 62 }, 63 63 "dist": { 64 64 "type": "zip", 65 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/ 683cf2462478fc54939de9bdcb0e49e8d42ef631",66 "reference": " 683cf2462478fc54939de9bdcb0e49e8d42ef631",65 "url": "https://api.github.com/repos/hizzle-co/datastore/zipball/1b867f0c029c87431ccfb9c76821f868d1d63875", 66 "reference": "1b867f0c029c87431ccfb9c76821f868d1d63875", 67 67 "shasum": "" 68 68 }, … … 70 70 "php": ">=5.3.0" 71 71 }, 72 "time": "202 5-11-06T07:39:20+00:00",72 "time": "2026-01-08T09:55:37+00:00", 73 73 "type": "library", 74 74 "installation-source": "dist", … … 99 99 "support": { 100 100 "issues": "https://github.com/hizzle-co/datastore/issues", 101 "source": "https://github.com/hizzle-co/datastore/tree/0.2.1 5"101 "source": "https://github.com/hizzle-co/datastore/tree/0.2.17" 102 102 }, 103 103 "install-path": "../hizzle/store" -
hizzle-downloads/trunk/vendor/composer/installed.php
r3424134 r3435015 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 0450caee14fe401d9beed36f42a0b086d7fd7140',6 'reference' => 'dfebdbe0fa191a0a76e5e45e018f0fd6f59ac1dd', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 0450caee14fe401d9beed36f42a0b086d7fd7140',16 'reference' => 'dfebdbe0fa191a0a76e5e45e018f0fd6f59ac1dd', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'hizzle/store' => array( 32 'pretty_version' => '0.2.1 5',33 'version' => '0.2.1 5.0',34 'reference' => ' 683cf2462478fc54939de9bdcb0e49e8d42ef631',32 'pretty_version' => '0.2.17', 33 'version' => '0.2.17.0', 34 'reference' => '1b867f0c029c87431ccfb9c76821f868d1d63875', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../hizzle/store', -
hizzle-downloads/trunk/vendor/hizzle/store/src/Collection.php
r3420634 r3435015 626 626 'default' => 25, 627 627 'minimum' => -1, 628 'maximum' => 100 ,628 'maximum' => 1000, 629 629 'sanitize_callback' => __CLASS__ . '::intval', 630 630 'validate_callback' => 'rest_validate_request_arg', -
hizzle-downloads/trunk/vendor/hizzle/store/src/Query.php
r3389422 r3435015 343 343 $offset = get_option( 'gmt_offset', 0 ); 344 344 345 // Ensure offset is a float 346 $offset = floatval( $offset ); 347 348 // Get the absolute value of the offset 349 $abs_offset = abs( $offset ); 350 351 // Calculate hours and minutes 352 $hours = floor( $abs_offset ); 353 $minutes = ( $abs_offset - $hours ) * 60; 354 355 // Format the offset string 356 $offset_string = sprintf( 357 '%s%02d:%02d', 358 $offset >= 0 ? '+' : '-', 359 $hours, 360 $minutes 361 ); 362 363 return $offset_string; 345 // Ensure offset is a float in minutes 346 $offset = floatval( $offset ) * 60; 347 348 if ( 0 > $offset ) { 349 return "DATE_SUB(%s, INTERVAL $offset MINUTE)"; 350 } 351 352 if ( 0 < $offset ) { 353 $offset = abs( $offset ); 354 return "DATE_ADD(%s, INTERVAL $offset MINUTE)"; 355 } 356 357 // If zero offset, return UTC 358 return '%s'; 364 359 } 365 360 … … 459 454 460 455 // Prepare groupby fields. 461 $timezone = esc_sql( $this->get_mysql_timezone_offset());456 $timezone_offset = $this->get_mysql_timezone_offset(); 462 457 if ( ! empty( $qv['groupby'] ) ) { 463 458 foreach ( wp_parse_list( $qv['groupby'] ) as $index => $field ) { … … 485 480 // Handle casting and timezone conversion 486 481 if ( $cast ) { 482 // Append cast_ prefix to avoid confusion 483 $field = 'cast_' . $field; 484 485 // Group by date parts with timezone conversion. 486 $local_time_table_field = sprintf( $timezone_offset, $table_field ); 487 487 switch ( $cast ) { 488 488 case 'hour': 489 $table_field = "DATE_FORMAT( CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-%m-%d %H:00:00')";489 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-%m-%d %H:00:00')"; 490 490 break; 491 491 case 'day': 492 $table_field = "DATE( CONVERT_TZ($table_field, '+00:00', '$timezone'))";492 $table_field = "DATE($local_time_table_field)"; 493 493 break; 494 494 case 'week': 495 $table_field = "DATE(DATE_SUB(CONVERT_TZ($table_field, '+00:00', '$timezone'), INTERVAL WEEKDAY(CONVERT_TZ($table_field, '+00:00', '$timezone')) DAY))"; 495 // Normalize the date to the Monday of the same week 496 // WEEKDAY($local_time_table_field) returns a number from 0 to 6, where Monday is 0 and Sunday is 6. 497 // This tells us how many days have passed since Monday for that date. 498 // DATE_SUB($local_time_table_field, INTERVAL WEEKDAY($local_time_table_field) DAY) subtracts that many days from the original date. 499 // The result is the Monday of the week that $local_time_table_field falls in. 500 // DATE(...) then strips off any time component and returns just the date. 501 $table_field = "DATE(DATE_SUB($local_time_table_field, INTERVAL WEEKDAY($local_time_table_field) DAY))"; 496 502 break; 497 503 case 'month': 498 $table_field = "DATE_FORMAT( CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-%m-01')";504 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-%m-01')"; 499 505 break; 500 506 case 'year': 501 $table_field = "DATE_FORMAT(CONVERT_TZ($table_field, '+00:00', '$timezone'), '%Y-01-01')"; 507 $table_field = "DATE_FORMAT($local_time_table_field, '%Y-01-01')"; 508 break; 509 case 'day_of_week': 510 // WEEKDAY(date) returns an integer from 0 to 6, where: 511 // 0 === Monday and 6 === Sunday 512 $table_field = "WEEKDAY($local_time_table_field)"; 502 513 break; 503 514 default: -
hizzle-downloads/trunk/vendor/hizzle/store/src/REST_Controller.php
r3420634 r3435015 615 615 $paged = (int) $query->query_vars['page']; 616 616 617 $max_pages = $total > 0 && $per_page > 1? ceil( $total / $per_page ) : 1;617 $max_pages = $total > 0 && $per_page > 0 ? ceil( $total / $per_page ) : 1; 618 618 619 619 $response = rest_ensure_response( -
hizzle-downloads/trunk/vendor/hizzle/store/src/Store.php
r3245426 r3435015 56 56 // Prepare the collections. 57 57 foreach ( $this->collections as $key => $collection ) { 58 if ( ! $collection instanceof Collection ) {59 $collection['name'] = $key;60 $this->collections[ $key ] = new Collection( $this->namespace, $collection );61 }62 }58 if ( ! $collection instanceof Collection ) { 59 $collection['name'] = $key; 60 $this->collections[ $key ] = new Collection( $this->namespace, $collection ); 61 } 62 } 63 63 64 64 // Register the store. … … 90 90 self::$instances[ $namespace ]->collections[ $key ] = $collections[ $key ]; 91 91 } 92 }92 } 93 93 94 94 return self::$instances[ $namespace ]; … … 150 150 151 151 /** 152 * Returns the table definitions as an array.153 *154 * @return string[]155 */156 public function get_schema() {152 * Returns the table definitions as an array. 153 * 154 * @return string[] 155 */ 156 public function get_schema() { 157 157 $schema = array(); 158 158 … … 164 164 return array_filter( $schema ); 165 165 } 166 167 166 }
Note: See TracChangeset
for help on using the changeset viewer.