Good Day I made alot of testing and i discovered that the new plugin version 5.0.10
is not 100% compatible with changed wp_content_dir & wp_content_url WORDPRESS Setup
is there’s any solution I needed to do?
also older version 4.1.11 works with this setup
thanks
]]>wp_upload_dir()
via ['basedir']
(you already are listing in your CONSTANTS list) to generate your path constants and the ['baseurl']
for your url constants?
]]>This happens every time I try to save an update to a page, save an edit to a stylesheet, save an edit to a php file, add a plugin, update a plugin, disable a plugin.
Basically, every single edit that I make will not go through due to this issue!
I’m also getting an error when I try to visit the WordPress general options via settings in the dashboard. The error is:
Warning: Use of undefined constant WP_CONTENT_DIR – assumed ‘WP_CONTENT_DIR’ (this will throw an Error in a future version of PHP) in /home2/donproject/public_html/wp-includes/load.php on line 115
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Deprecated: Directive ‘allow_url_include’ is deprecated in Unknown on line 0
Attempted Solutions:
So far I have reset the max file sizes by updating values in the php.ini The current htaccess values are as follows:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
php_flag asp_tags Off
php_flag display_errors On
php_value max_execution_time 300
php_value max_input_time 1000
php_value max_input_vars 1000
php_value memory_limit 256M
php_value post_max_size 260M
php_value session.gc_maxlifetime 1440
php_value session.save_path “/tmp”
php_value upload_max_filesize 256M
php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
php_flag asp_tags Off
php_flag display_errors On
php_value max_execution_time 300
php_value max_input_time 1000
php_value max_input_vars 1000
php_value memory_limit 256M
php_value post_max_size 260M
php_value session.gc_maxlifetime 1440
php_value session.save_path “/tmp”
php_value upload_max_filesize 256M
php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
I also recently updated our PHP version from 5.4 to 7.4 and that did not solve the issue.
As for the WordPress General options error, I cannot find the directive listed and have not been able to update that deprecated code so nothing has been done on that front.
]]>"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
This rendered the whole website unusable.
Error in cPanel:
2020-01-17 23:22:27.196820 [NOTICE] [3474734] [...] [STDERR]
PHP Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in /home/yamonkic/public_html/wp-includes/load.php on line 141
Line 141 in load.php:
if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
I had the same before so I started with a clean sheet totally new install, but it happens again!
I must have read hundreds of people’s similar experience and tried the problem solving as commented to those people. A lot of sources on the internet call for a check of PHP version and activation of extensions. I have checked these many times and they were and are always correct.
<strong>### wp-core ###</strong>
version: 5.3.2
site_language: tr_TR
user_language: en_US
timezone: +03:00
permalink: /%postname%/
https_status: true
user_registration: 1
default_comment_status: closed
multisite: false
user_count: 4
dotorg_communication: true
### wp-paths-sizes ###
wordpress_path: /home/yamonkic/public_html
wordpress_size: 45.76 MB (47984863 bytes)
uploads_path: /home/yamonkic/public_html/wp-content/uploads
uploads_size: 81.35 MB (85302643 bytes)
themes_path: /home/yamonkic/public_html/wp-content/themes
themes_size: 31.39 MB (32910048 bytes)
plugins_path: /home/yamonkic/public_html/wp-content/plugins
plugins_size: 89.56 MB (93912047 bytes)
database_size: 12.82 MB (13441108 bytes)
total_size: 260.88 MB (273550709 bytes)
### wp-active-theme ###
name: Porto Child (porto-child)
version: 1.1
author: P-THEMES
author_website: https://www.portotheme.com/
parent_theme: Porto (porto)
theme_features: post-thumbnails, title-tag, editor-style, automatic-feed-links, woocommerce, menus, post-formats, wp-block-styles, responsive-embeds, align-wide, editor-styles, editor-color-palette, widgets
theme_path: /home/yamonkic/public_html/wp-content/themes/porto-child
### wp-parent-theme ###
name: Porto (porto)
version: 5.2.0
author: P-THEMES
author_website: https://www.portotheme.com/
theme_path: /home/yamonkic/public_html/wp-content/themes/porto
### wp-themes-inactive (2) ###
Twenty Nineteen: version: 1.4, author: the WordPress team
Twenty Twenty: version: 1.1, author: the WordPress team
### wp-plugins-active (9) ###
Coming Soon Page & Maintenance Mode by SeedProd: version: 5.1.0, author: SeedProd
Contact Form 7: version: 5.1.6, author: Takayuki Miyoshi
Loco Translate: version: 2.3.1, author: Tim Whitlock
Porto Theme - Functionality: version: 1.5.2, author: P-Themes
WooCommerce: version: 3.8.1, author: Automattic
Woo Discount Rules: version: 1.9.2, author: Flycart Technologies LLP
WPBakery Page Builder: version: 6.0.5, author: Michael M - WPBakery.com (latest version: 6.1)
WP Fastest Cache: version: 0.9.0.1, author: Emre Vona
WP Mail SMTP: version: 1.8.1, author: WPForms
### wp-plugins-inactive (6) ###
iThemes Security: version: 7.6.1, author: iThemes
WooCommerce Multilingual: version: 4.7.6, author: OnTheGoSystems
WPML Media: version: 2.5.5, author: OnTheGoSystems
WPML Multilingual CMS: version: 4.3.5, author: OnTheGoSystems
WPML String Translation: version: 3.0.5, author: OnTheGoSystems
WPML Translation Management: version: 2.9.3, author: OnTheGoSystems
### wp-media ###
image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
gd_version: 2.2.5
ghostscript_version: 9.25
### wp-server ###
server_architecture: Linux 3.10.0-962.3.2.lve1.5.26.9.el7.x86_64 x86_64
httpd_software: LiteSpeed
php_version: 7.4.0 64bit
php_sapi: litespeed
max_input_variables: 6000
time_limit: 300
memory_limit: 256M
max_input_time: 600
upload_max_size: 2M
php_post_max_size: 8M
curl_version: 7.62.0 OpenSSL/1.0.2k
suhosin: false
imagick_availability: false
htaccess_extra_rules: true
### wp-database ###
extension: mysqli
server_version: 10.3.20-MariaDB
client_version: 10.3.20-MariaDB
### wp-constants ###
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/yamonkic/public_html/wp-content
WP_PLUGIN_DIR: /home/yamonkic/public_html/wp-content/plugins
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_LOCAL_DEV: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined
### wp-filesystem ###
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
]]>Please consider using the constant WP_CONTENT_DIR
instead of hardcoding the wp-content
folder on lines 286 and 292 in elementor-custom-icons.php
(explode() delimiter).
This will make the plugin work if your wp-content folder is changed for security reasons. Check Hardening WordPress page in Codex if you don’t know what is it about.
Many thanks in advance, and keep up the great work.
R
PS: Is there a github repo? I couldn’t find it…
]]>I am with Pressable Customer Support. I wanted to propose a change in the way the plugin defines paths for the WAF.
On line 7376 of wordfenceClass.php there is this function:
public static function getWAFBootstrapPath() {
return ABSPATH . ‘wordfence-waf.php’;
}
On Pressable, ABSPATH
is the location of the core WordPress files. However, those core files are not the same location of the site root.
I’d like to suggest a possible workaround, which will at least work on Pressable sites:
public static function getWAFBootstrapPath() {
if (is_writeable(ABSPATH)) {
return ABSPATH . ‘wordfence-waf.php’;
} else {
return str_replace(‘/wp-content’,”,WP_CONTENT_DIR);
}
}
With a function like this, the Wordfence WAF would enable without issue.
Also, our Director of Support had previously requested a similar change a year ago: https://www.ads-software.com/support/topic/use-wp_content_dir-instead-of-abspath-for-wordfence-waf-php-creation/
Thanks in advance for your consideration!
Best,
Bradly M. Hale
Pressable Customer Support
├── content/
│?? ├── index.php
│?? ├── ngg/
│?? ├── plugins/
│?? ├── themes/
│?? ├── upgrade/
│?? └── uploads/
├── core/
│?? ├── wp-admin/
│?? ├── wp-content/
│?? ├── wp-includes/
│?? ├── ...etc...
├── index.php
└── wp-config.php
I have my WP_CONTENT_DIR set appropriately to content/
but when creating new galleries, ngg is placing them in core/wp-content/gallery
instead of content/gallery
.
I’ve confirmed that WP_CONTENT_DIR, NGG_IMPORT_ROOT, and NEXTGEN_GALLERY_IMPORT_ROOT are all pointed to the correct directory (content/
in my case). I’m using full paths in WP_CONTENT_DIR too, I’m just omitting it here for brevity.
NGG seems to know about the correct content dir when it created content/ngg
but galleries are being created in the ‘default’ wp-content instead of the dir specified by WP_CONTENT_DIR.
“wp-content” is hardcoded in /products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php inside of the $this->_local_settings
field:
$this->_local_settings = array(
'gallerypath'? => 'wp-content'.DIRECTORY_SEPARATOR.'gallery'.DIRECTORY_SEPARATOR,
//..
//...
);
This is possibly the cause, but I will need to do some testing to confirm. Is this a known issue that already has a solution?
]]>As wordpress allow to change the name of the content dir, you should not use wp-content in this function, this directory is defined by WP_CONTENT_DIR :
$pos = strpos($dirFromFile, ‘wp-content’)+strlen(‘wp-content’);
Should be :
$pos = strpos($dirFromFile, WP_CONTENT_DIR)+strlen(WP_CONTENT_DIR);
]]>[12-May-2017 19:40:45 UTC] PHP Notice: Trying to get property of non-object in /var/www/public/defiant-bat/wp-content/plugins/accelerated-mobile-pages/accelerated-moblie-pages.php on line 39
[12-May-2017 19:40:45 UTC] PHP Notice: AMP_Post_Template::verify_and_include was called <strong>incorrectly</strong>. Path validation for template () failed. Path cannot traverse and must be located in <code>WP_CONTENT_DIR</code>. Please see <a href="https://codex.www.ads-software.com/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 0.1.) in /var/www/public/defiant-bat/wp-includes/functions.php on line 4138
[12-May-2017 19:40:45 UTC] PHP Notice: Undefined variable: post_id in /var/www/public/defiant-bat/wp-content/plugins/accelerated-mobile-pages/templates/design-manager/design-2/style.php on line 10
[12-May-2017 19:40:45 UTC] PHP Notice: Undefined index: opt-color-rgba in /var/www/public/defiant-bat/wp-content/plugins/accelerated-mobile-pages/templates/design-manager/design-2/style.php on line 245
Partial reported in #827 before relase.
Live test page, debug log