| @@ -47,13 +47,8 @@ | ||
| 47 | 47 | if ( ! $phpspreadsheet_requirements_fulfilled ) { |
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - // Use the legacy evaluate class, if the PHPSpreadsheet files do not exist (e.g. because `composer install` was not run). | |
| 52 | - if ( ! file_exists( TABLEPRESS_ABSPATH . 'libraries/autoload.php' ) ) { | |
| 53 | - return true; | |
| 54 | - } | |
| 55 | - | |
| 56 | 51 | return false; |
| 57 | 52 | } |
| 58 | 53 | |
| 59 | 54 | /** |
| @@ -65,12 +60,10 @@ | ||
| 65 | 60 | * @param string $table_id ID of the passed table. |
| 66 | 61 | * @return array<int, array<int, string>> Table data with evaluated formulas. |
| 67 | 62 | */ |
| 68 | 63 | public function evaluate_table_data( array $table_data, string $table_id ): array { |
| 69 | - $use_legacy_evaluate_class = $this->_should_use_legacy_evaluate_class(); | |
| 70 | - | |
| 71 | 64 | // Choose the Table Evaluate library based on the PHP version and the filter hook value. |
| 72 | - if ( $use_legacy_evaluate_class ) { | |
| 65 | + if ( $this->_should_use_legacy_evaluate_class() ) { | |
| 73 | 66 | $evaluate_class = TablePress::load_class( 'TablePress_Evaluate_Legacy', 'class-evaluate-legacy.php', 'classes' ); |
| 74 | 67 | } else { |
| 75 | 68 | $evaluate_class = TablePress::load_class( 'TablePress_Evaluate_PHPSpreadsheet', 'class-evaluate-phpspreadsheet.php', 'classes' ); |
| 76 | 69 | } |