diff --git a/bootstrap/load.php b/bootstrap/load.php index 02cb8435..1a18c45c 100644 --- a/bootstrap/load.php +++ b/bootstrap/load.php @@ -245,6 +245,7 @@ function can_load_class() { * * @since 1.0.0 * @since 2.5.1 Now handles mixed-case class names. + * @since 2.6.0 Now uses `hrtime()` instead of `microtime()`. * @uses TSF_EXTENSION_MANAGER_DIR_PATH_CLASS * @access private * @@ -275,7 +276,7 @@ function _autoload_classes( $class ) { static $_timenow = true; // Prevent running two timers at once, restart timing once done loading batch. if ( $_timenow ) { - $_bootstrap_timer = microtime( true ); + $_bootstrap_timer = hrtime( true ); $_timenow = false; } else { $_bootstrap_timer = 0; @@ -293,7 +294,7 @@ function _autoload_classes( $class ) { require TSF_EXTENSION_MANAGER_DIR_PATH_CLASS . "{$rel_dir}{$file}.class.php"; if ( $_bootstrap_timer ) { - $_t = microtime( true ) - $_bootstrap_timer; + $_t = ( hrtime( true ) - $_bootstrap_timer ) / 1e9; \The_SEO_Framework\_bootstrap_timer( $_t ); \TSF_Extension_Manager\_bootstrap_timer( $_t ); $_timenow = true; diff --git a/composer.json b/composer.json index dcca1495..712ec910 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": "~7.2 || ^8.0 || ^8.1", + "php": "~7.3 || ^8.0 || ^8.1", "composer/installers": "^1.0" }, "require-dev": { diff --git a/extensions/essentials/articles/trunk/views/sitemap/news.php b/extensions/essentials/articles/trunk/views/sitemap/news.php index 7f20c8da..c19033f0 100644 --- a/extensions/essentials/articles/trunk/views/sitemap/news.php +++ b/extensions/essentials/articles/trunk/views/sitemap/news.php @@ -11,7 +11,7 @@ $tsf = the_seo_framework(); -$tsf->the_seo_framework_debug and $timer_start = microtime( true ); +$tsf->the_seo_framework_debug and $timer_start = hrtime( true ); $sitemap_bridge = \The_SEO_Framework\Bridges\Sitemap::get_instance(); @@ -54,7 +54,7 @@ class_alias( '\The_SEO_Framework\Builders\Sitemap', '\The_SEO_Framework\Builders echo "\n" . ''; echo "\n" . ''; echo "\n" . ''; - echo "\n" . ''; + echo "\n" . ''; echo "\n" . ''; echo "\n" . ''; } diff --git a/extensions/free/amp/trunk/amp.php b/extensions/free/amp/trunk/amp.php index 76e0bd72..e1936d63 100644 --- a/extensions/free/amp/trunk/amp.php +++ b/extensions/free/amp/trunk/amp.php @@ -117,7 +117,7 @@ public function do_output_hook() { \do_action( 'the_seo_framework_do_before_amp_output' ); - $output_start = microtime( true ); + $output_start = hrtime( true ); $output = ''; @@ -129,7 +129,10 @@ public function do_output_hook() { $output = $tsf->get_plugin_indicator( 'before' ) . $output - . $tsf->get_plugin_indicator( 'after', $output_start ); + . $tsf->get_plugin_indicator( + 'after', + ( $output_start - hrtime( true ) ) / 1e9 + ); // phpcs:ignore, WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped. echo PHP_EOL . $output . PHP_EOL; diff --git a/extensions/free/transport/trunk/inc/classes/importers/postmeta/core.class.php b/extensions/free/transport/trunk/inc/classes/importers/postmeta/core.class.php index e1cc85e2..6e1df341 100644 --- a/extensions/free/transport/trunk/inc/classes/importers/postmeta/core.class.php +++ b/extensions/free/transport/trunk/inc/classes/importers/postmeta/core.class.php @@ -322,24 +322,6 @@ final public function import() { ] ); } else { - if ( 1984 == $post_id ) - yield 'debug' => - [ - - [ - 'transport_value' => $transport_value, - 'post_id' => $post_id, - 'from_data' => $transmuter['from_data'] ?? null, - 'from' => [ $from_table, $from_index ], - 'existing_value' => $existing_value, - 'has_transmuter_to' => $has_transmuter_to, - 'set_value' => $set_value, - ], - $actions, - $results, - $cleanup, - ]; - // $actions and $results are passed by reference. $this->transmute( $set_value, diff --git a/extensions/free/transport/trunk/inc/classes/logger/store.class.php b/extensions/free/transport/trunk/inc/classes/logger/store.class.php index 341cff90..5a7dac39 100644 --- a/extensions/free/transport/trunk/inc/classes/logger/store.class.php +++ b/extensions/free/transport/trunk/inc/classes/logger/store.class.php @@ -49,7 +49,7 @@ public function __construct( $id ) { * @param mixed $data The data to store */ public function store( $data ) { - static::$store[ $this->id ][ uniqid( microtime( true ), true ) ] = $data; + static::$store[ $this->id ][ uniqid( hrtime( true ), true ) ] = $data; } /** diff --git a/inc/classes/core.class.php b/inc/classes/core.class.php index 50f35563..931086ed 100644 --- a/inc/classes/core.class.php +++ b/inc/classes/core.class.php @@ -1144,7 +1144,8 @@ final protected function get_extension_autload_path( $namespace ) { * @since 1.2.0 * @since 1.3.0 Now handles namespaces instead of class bases. * @since 2.5.1 Now supports mixed class case. - * @since 2.6.0 Now supports branched path files. + * @since 2.6.0 1. Now supports branched path files. + * 2. Now uses `hrtime()` instead of `microtime()`. * * @param string $class The extension classname. * @return bool False if file hasn't yet been included, otherwise true. @@ -1169,7 +1170,7 @@ final protected function autoload_extension_class( $class ) { static $_timenow = true; if ( $_timenow ) { - $_bootstrap_timer = microtime( true ); + $_bootstrap_timer = hrtime( true ); $_timenow = false; } else { $_bootstrap_timer = 0; @@ -1200,7 +1201,7 @@ final protected function autoload_extension_class( $class ) { } if ( $_bootstrap_timer ) { - $_t = microtime( true ) - $_bootstrap_timer; + $_t = ( hrtime( true ) - $_bootstrap_timer ) / 1e9; // ns to s \The_SEO_Framework\_bootstrap_timer( $_t ); \TSF_Extension_Manager\_bootstrap_timer( $_t ); $_timenow = true; diff --git a/readme.txt b/readme.txt index 11cbf689..23bbee28 100644 --- a/readme.txt +++ b/readme.txt @@ -52,10 +52,11 @@ Please refer to [the installation instructions on our website](https://kb.theseo * TODO Use tsf() insteadof the_seo_framework() * TODO use API functions of TSF (memo, has_run, isset()?..: et al.) * TODO refactor coalesce_var to PHP 7.0+. -* TODO Start requiring PHP 7.2+ +* Start requiring PHP 7.3+ * We'd love to use 7.3+ but 4.2% of our users are on 7.2 or lower (measured 2022/07/10). * Otto said we'd have to learn from because it's leading. It's only off by an insignificant 10% of all users. - * Let's henceforth rely on our data. TODO remeasure, compare change. + * Let's henceforth rely on our data. ...remeasure, compare change. + * Found less than 2.2% use PHP 7.2 or lower (1.8% uses 7.2) * Moved TSF installation hanlder to a different file. * Improved letter spacing from logos. TODO remove png files, all browsers support svg now. @@ -103,8 +104,6 @@ TODO (FIXED, clean up) instead of a fancy observer on logger, we might simply ju TODO Reevaluate get_view()'s implicated extract() and the use of get_defined_vars() - Neither of these can be populated by the user, still, they are an exploit waiting to happen. -TODO we use hrtime(), PHP 7.3+.... ooops? - = 2.5.3 = **Release date:** diff --git a/the-seo-framework-extension-manager.php b/the-seo-framework-extension-manager.php index 5cc19456..587a7d3a 100644 --- a/the-seo-framework-extension-manager.php +++ b/the-seo-framework-extension-manager.php @@ -3,14 +3,14 @@ * Plugin Name: The SEO Framework - Extension Manager * Plugin URI: https://theseoframework.com/extension-manager/ * Description: Add more powerful SEO features to The SEO Framework. Right from your WordPress dashboard. - * Version: 2.6.0-dev-10 + * Version: 2.6.0-dev-11 * Author: The SEO Framework Team * Author URI: https://theseoframework.com/ * License: GPLv3 * Text Domain: the-seo-framework-extension-manager * Domain Path: /language * Requires at least: 5.5 - * Requires PHP: 7.2.0 + * Requires PHP: 7.3.0 * * @package TSF_Extension_Manager\Bootstrap */