Error: WP was installed in subfolder file_get_contents merge-minify-refresh.php
-
Merge + Minify + Refresh
Version 1.6.12 | Por Launch Interactive
Wordpress version: 4.6.1Error: WP was installed in subfolder
The error is in file: merge-minify-refresh.php on line 440.
The problem: The file_get_contents not found the file.Warning: file_get_contents(/home/alfaunif/public_html/wp-includes/js/jquery/jquery.js): failed to open stream: No such file or directory in /home/alfaunif/public_html/wp/wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php on line 440
In my case the WP was installed in /home/alfaunif/public_html/wp/wp-includes/ directory.
I solve this problem and if you want you could add this lines to the core plugin to nobody has this problem again.
Add lines to solve:
class MergeMinifyRefresh
Close to the line 40private $wordpressdir = ''; private $wordpressdirWithSlash = ''; //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder.
public function __construct() {
Close to the line 80$this->root = $_SERVER["DOCUMENT_ROOT"]; $this->wordpressdir = parse_url(get_site_url(), PHP_URL_PATH); $this->wordpressdirWithSlash = $this->wordpressdir . "/"; //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder.
public function inspect_scripts() {
Close to the line 350$script_path = parse_url($this->ensure_scheme($wp_scripts->registered[$handle]->src), PHP_URL_PATH); if($this->wordpressdir != '' && substr($script_path, 0, strlen($this->wordpressdir)) != $this->wordpressdir) { $script_path = $this->wordpressdir . $script_path; } //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder. if(substr($script_path, 0, strlen($this->wordpressdirWithSlash)) != $this->wordpressdirWithSlash) { $script_path = $this->wordpressdir . $script_path; }
public function inspect_scripts() {
Close to the line 418$script_path = parse_url($this->ensure_scheme($wp_scripts->registered[$handle]->src), PHP_URL_PATH); if($this->wordpressdir != '' && substr($script_path, 0, strlen($this->wordpressdir)) != $this->wordpressdir) { $script_path = $this->wordpressdir . $script_path; } if(substr($script_path, -7) == '.min.js') { $nomin_path = substr($script_path, 0, -7) . '.js'; if(is_file($this->root.$nomin_path)) { $script_path = $nomin_path; $log .= " - unminified version used"; } } //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder. if(substr($script_path, 0, strlen($this->wordpressdirWithSlash)) != $this->wordpressdirWithSlash) { $script_path = $this->wordpressdir . $script_path; }
public function inspect_stylescripts_footer() {
Close to the line 510$script_path = parse_url($this->ensure_scheme($wp_scripts->registered[$handle]->src), PHP_URL_PATH); if($this->wordpressdir != '' && substr($script_path, 0, strlen($this->wordpressdir)) != $this->wordpressdir) { $script_path = $this->wordpressdir . $script_path; } //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder. if(substr($script_path, 0, strlen($this->wordpressdirWithSlash)) != $this->wordpressdirWithSlash) { $script_path = $this->wordpressdir . $script_path; }
public function inspect_stylescripts_footer() {
Close to the line 540$script_path = parse_url($this->ensure_scheme($wp_scripts->registered[$handle]->src), PHP_URL_PATH); if($this->wordpressdir != '' && substr($script_path, 0, strlen($this->wordpressdir)) != $this->wordpressdir) { $script_path = $this->wordpressdir . $script_path; } if(substr($script_path, -7) == '.min.js') { $nomin_path = substr($script_path, 0, -7) . '.js'; if(is_file($this->root.$nomin_path)) { $script_path = $nomin_path; $log .= " - unminified version used"; } } //Added by Israel Roldan @airvzxf on November 12, 2016. Solve the problem when the main WP directory is in subfolder. if(substr($script_path, 0, strlen($this->wordpressdirWithSlash)) != $this->wordpressdirWithSlash) { $script_path = $this->wordpressdir . $script_path; }
- The topic ‘Error: WP was installed in subfolder file_get_contents merge-minify-refresh.php’ is closed to new replies.