admin管理员组文章数量:1391943
I would like to change one image that is apparently still hosted on HTTP on my client's website so that it will be re-uploaded on HTTPS.
Using the Inspect feature of my Chrome browser, I spotted the file and it seems to be coming from a file referenced in a link tag with the following structure (altered slightly here for security reasons):
<link rel='stylesheet' id='SAMPLETHEME-theme-css-css' href='.php?ver=4.9.13' type='text/css' media='all' />
When I open the above file in my browser, it seems to be a CSS file and I can see where this old image is located and that it has an HTTP address, which needs to change.
After failing to find the file in the admin panel, I got access to the FTP location of the host. Inside the FTP, I looked for the corresponding folder under SAMPLETHEME-child
and then navigate to /lib/theme-engine/
to find style.php
. And I do find the file. Except that it does not have the same content as when I opened in the browser.
Does this .php file simply generate another new file when run? At least that's what I have gathered from its code. Below is what the file contains. But the image I am looking for I am still yet to find!
<?php
/**
* Set header
*/
header( "Content-type: text/css", true );
/**
* Set constants
*/
define( 'STYLESHEET_FILENAME', 'style.css' );
define( 'STYLESHEET_DEV_PATH', 'dev/' );
/**
* Generates a CSS file based on different settings
* @return string
*/
function generate_css() {
/**
* If merged stylesheet exists, load - else create a new file.
*/
if ( file_exists( STYLESHEET_FILENAME ) ) {
return file_get_contents( STYLESHEET_FILENAME );
} else {
/*
* Load WordPress core
*/
define( 'WP_USE_THEMES', false );
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );
/**
* Prepare new merged stylesheet
*/
$output = "";
$files = scandir( STYLESHEET_DEV_PATH );
foreach ( $files as $file ) {
// Parse CSS file
$data = parse_file( $file );
// Parse font variables
$data = parse_font_style( $data );
// Compress CSS and add to queue
$output .= compress( $data );
}
/**
* If production is running, save file
*/
if ( get_option( 'getup_theme_production', false ) == true ) {
file_put_contents( STYLESHEET_FILENAME, $output );
}
return $output;
}
}
/**
* Parse file
*
* @param $filename
*
* @return string
*/
function parse_file( $filename ) {
$ext = pathinfo( $filename, PATHINFO_EXTENSION );
if ( $ext == 'css' ) {
$data = file_get_contents( STYLESHEET_DEV_PATH . $filename );
/** Logic to parse variables **/
return $data;
}
}
/**
* Compress CSS file
*
* @param $buffer string
*
* @return string
*/
function compress( $buffer ) {
/* remove comments */
$buffer = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer );
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace( array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), '', $buffer );
return $buffer;
}
/**
* Parse and process font style variables
*
* @param $data
*
* @return string
*/
function parse_font_style( $data ) {
$font_family = get_option( 'getup_theme_font_family', "'BRANDFILE', serif" );
$font = get_option( 'getup_theme_font', '+Sans:400,600,700' );
$search = array( '$font-family$', '$font$' );
$replace = array( $font_family, $font );
$data = str_replace( $search, $replace, $data );
return $data;
}
echo generate_css();
本文标签: The stylephp file inside themeengine folder has other content on FTP
版权声明:本文标题:The style.php file inside theme-engine folder has other content on FTP 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744694263a2620180.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论