| @@ -7,8 +7,10 @@ | ||
| 7 | 7 | * @author Tobias Bäthge |
| 8 | 8 | * @since 1.1.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +declare(strict_types=1); | |
| 12 | + | |
| 11 | 13 | // Prohibit direct script loading. |
| 12 | 14 | defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); |
| 13 | 15 | |
| 14 | 16 | /** |
| @@ -246,9 +248,9 @@ | ||
| 246 | 248 | /* |
| 247 | 249 | * Do we have credentials already? (Otherwise the form will have been rendered, which is not supported here.) |
| 248 | 250 | * Or, if we have credentials, are they valid? |
| 249 | 251 | */ |
| 250 | - if ( false === $credentials || ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore-line | |
| 252 | + if ( false === $credentials || ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore argument.type | |
| 251 | 253 | ob_end_clean(); |
| 252 | 254 | return false; |
| 253 | 255 | } |
| 254 | 256 | |
| @@ -278,18 +280,18 @@ | ||
| 278 | 280 | $credentials = request_filesystem_credentials( '', '', false, '', null, false ); |
| 279 | 281 | // Do we have credentials already? Otherwise the form will have been rendered already. |
| 280 | 282 | if ( false === $credentials ) { |
| 281 | 283 | $form_data = ob_get_clean(); |
| 282 | - $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data ); // @phpstan-ignore-line | |
| 284 | + $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="components-button is-primary"', $form_data ); // @phpstan-ignore argument.type | |
| 283 | 285 | return $form_data; |
| 284 | 286 | } |
| 285 | 287 | |
| 286 | 288 | // We have received credentials, but don't know if they are valid yet. |
| 287 | - if ( ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore-line | |
| 289 | + if ( ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore argument.type | |
| 288 | 290 | // Credentials failed, so ask again (with $error flag true). |
| 289 | 291 | request_filesystem_credentials( '', '', true, '', null, false ); |
| 290 | 292 | $form_data = ob_get_clean(); |
| 291 | - $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data ); // @phpstan-ignore-line | |
| 293 | + $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="components-button is-primary"', $form_data ); // @phpstan-ignore argument.type | |
| 292 | 294 | return $form_data; |
| 293 | 295 | } |
| 294 | 296 | |
| 295 | 297 | // We have valid access to the filesystem now -> try to save the files, or delete them if the "Custom CSS" is empty. |
| @@ -328,14 +330,8 @@ | ||
| 328 | 330 | |
| 329 | 331 | $default_css_minified = $this->load_default_css_from_file( false ); |
| 330 | 332 | if ( false === $default_css_minified ) { |
| 331 | 333 | $default_css_minified = ''; |
| 332 | - } else { | |
| 333 | - // Change relative URLs to web font files to absolute URLs, as combining the CSS files and saving to another directory breaks the relative URLs. | |
| 334 | - $absolute_path = plugins_url( 'css/build/tablepress.', TABLEPRESS__FILE__ ); | |
| 335 | - // Make the absolute URL protocol-relative to prevent mixed content warnings. | |
| 336 | - $absolute_path = str_replace( array( 'http:', 'https:' ), '', $absolute_path ); | |
| 337 | - $default_css_minified = str_replace( 'url(tablepress.', 'url(' . $absolute_path, $default_css_minified ); | |
| 338 | 334 | } |
| 339 | 335 | $file_content = array( |
| 340 | 336 | 'normal' => $custom_css_normal, |
| 341 | 337 | 'minified' => $custom_css_minified, |
| @@ -377,9 +373,9 @@ | ||
| 377 | 373 | /* |
| 378 | 374 | * Do we have credentials already? (Otherwise the form will have been rendered, which is not supported here.) |
| 379 | 375 | * Or, if we have credentials, are they valid? |
| 380 | 376 | */ |
| 381 | - if ( false === $credentials || ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore-line | |
| 377 | + if ( false === $credentials || ! WP_Filesystem( $credentials ) ) { // @phpstan-ignore argument.type | |
| 382 | 378 | ob_end_clean(); |
| 383 | 379 | return false; |
| 384 | 380 | } |
| 385 | 381 | |
| @@ -449,9 +445,9 @@ | ||
| 449 | 445 | w3tc_minify_flush(); |
| 450 | 446 | } |
| 451 | 447 | // WP Fastest Cache. |
| 452 | 448 | if ( isset( $GLOBALS['wp_fastest_cache'] ) && is_callable( array( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ) ) { |
| 453 | - $GLOBALS['wp_fastest_cache']->deleteCache( true ); // @phpstan-ignore-line | |
| 449 | + $GLOBALS['wp_fastest_cache']->deleteCache( true ); // @phpstan-ignore method.nonObject | |
| 454 | 450 | } |
| 455 | 451 | } |
| 456 | 452 | |
| 457 | 453 | } // class TablePress_CSS |