I use the Astra theme and get these errors if I activate XXX/wp-admin/plugins.phpplugins.php?safe_mode=1:
Warning: require_once(/XXXXXXXX/wp-content/themes/twentytwentyone/inc/core/class-astra-theme-options.php): failed to open stream: No such file or directory in /home/clients/647eef0deb86897c94a0151a16fa17b7/test/wp-content/themes/astra/functions.php on line 33
Fatal error: require_once(): Failed opening required ‘/XXXXXXXX/wp-content/themes/twentytwentyone/inc/core/class-astra-theme-options.php’ (include_path=’.:/opt/php7.3/lib/php’) in /home/clients/647eef0deb86897c94a0151a16fa17b7/test/wp-content/themes/astra/functions.php on line 33
Perhaps it’s an incompatibility with the Astra theme. Can you help?
Regards
Michael
Hey Team,
Why not take this plugin a step further and enable plugins to be specified with the URL during safe mode.
eg. https://www.mysite.com?safe_mode=1&plugins=akismet|woocommerce|wordpress-importer
(The above URL would disable all plugins, except Akismet, WooCommerce & WordPress Importer. Allowing me to test if all 3 plugins play nicely or not)
—
This plugin is great, but the majority of the time I need to use safe mode, its because I have a plugin conflict (or suspected conflict) and I need to test a plugin (or a few plugins) without having ALL my plugins enabled.
This would be a killer feature.
]]>Safe_mode worked great before I upgraded WordPress a few months ago, but it hasn’t worked since ?? When I append “?safe_mode=1” to the URL, the site loads exactly as normally. My theme is Divi 3 from Elegant Themes.
]]>The plugin works great for me, and thought I might share this tip.
I was personally using this plugin to look into a slider plugin that was having an error so I needed to disable all plugins except for that one.
The way I did this was to go into wp-content/mu-plugins/ and edit the safe mode loader. I changed the empty array of active plugins to array('revslider/revslider.php')
(since I wanted Revolution Slider to still be active).
This made it so everything was disabled according using Safe Mode except for the one I was inspecting. I’d imagine this could work with multiple plugins by changing the array to include what you want active.
]]>I have u-design theme activated and it isn’t working with it out the box.
Warning: require_once(..themes/twentyfourteen/scripts/portfolio-item-thumbnail.php): failed to open stream: No such file or directory in .../themes/u-design/functions.php on line 1565
Fatal error: require_once(): Failed opening required '.../themes/twentyfourteen/scripts/portfolio-item-thumbnail.php' (include_path='.:/usr/lib/php5.4') in .../themes/u-design/functions.php on line 1565
that’s because line 1565 is
require_once( get_template_directory() . '/scripts/portfolio-item-thumbnail.php' );
well duh…there is no script folder in twentyfourteen
obviously the problem is checking if the file exists
added
if(file_exists(get_template_directory() . '/scripts/portfolio-item-thumbnail.php' ))
works fine.
But why is it even accessing the udesign theme at all let alone its functions?
]]>There’s a typo in loader/safe-mode-loader.php
, lines 47 & 48:
if(array_key_exists('twentytthirteen', $themes))
return 'twentytthirteen';
This should be:
if(array_key_exists('twentythirteen', $themes))
return 'twentythirteen';
Also, as I like to recommend this plugin in the WordPress forums, it would nice if you could fix the warnings that displayed when WordPress is in DEBUG mode. Specifically, line 38 in loader/safe-mode-loader.php
:
if(defined(WP_DEFAULT_THEME))
should be
if(defined('WP_DEFAULT_THEME'))
And the if statement on line 22, change:
if($_GET['safe_mode'] == '1')
to
if(isset($_GET['safe_mode']) && $_GET['safe_mode'] == '1')
Thank you – this would make this awesome plugin even more awesome!
]]>Nice plugin.
Instead of searching for a safe theme by guessing, use the constant WP_DEFAULT_THEME. This holds the subfolder name of the default theme for the actual WordPress version. This will then be robust for twentythirteen and so on, or whatever names later default themes will have.
]]>