• Resolved gdelisle

    (@gdelisle)


    The most recent update to the BWS plugins has changed the BWS products menu so that it’s breaking the wp-admin interface. The calls to the BWS menu scripts, styles, and images are all referencing an incorrect path, which I believe is constructed with this method:

    		$bws_menu_current_dir = str_replace( '\\', '/', dirname( __FILE__ ) );
    		$bws_menu_abspath = str_replace( '\\', '/', ABSPATH );
    		$bws_menu_current_url = site_url( str_replace( $bws_menu_abspath, '', $bws_menu_current_dir ) );
    
    		return sprintf( '%s/%s', $bws_menu_current_url, $path );

    The result is that not only the BWS menu is broken, but several other core admin functions including the WP visual editor. Please fix this bug in your code, the previous version of this plugin works perfectly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Thank you for contacting us!

    In order to find the problem, please install and activate Query Monitor (https://www.ads-software.com/plugins/query-monitor/) WordPress plugin.
    Login to your dashboard.
    If there are some errors, you’ll see the red menu in the Query Monitor adminbar. Please click on the “Warnings” menu item.
    After that, you’ll see “PHP Error” block with the indication of the errors encountered. Please take the screenshot of these errors. Provide us with them.

    For more convenience, you can do it via our Help Center (https://support.bestwebsoft.com/hc/en-us/requests/new) in order to receive a faster reply.

    Sincerely,
    BestWebSoft Support Team

    Thread Starter gdelisle

    (@gdelisle)

    Hi, thanks for your reply. I have already found the problem. As I explained, this is not a PHP error but an incorrect path, which results in 404 errors in the web server. This probably results from the way you are creating $bws_menu_current_dir which does not respect the WP constants like WP_CONTENT_DIR, WP_CONTENT_URL, WP_PLUGIN_DIR and so on. In installations like mine where these constants are set in wp-config.php, they tell WP exactly where to look for the plugins directory instead of assuming the path is the same as the directory on the machine. As a result your variable is looking for a directory on my web server that doesn’t exist. Since you load scripts, styles, and images via this incorrect path, your BWS menu area is broken and the javascript errors are somehow compromising other areas of the admin. A rollback to Captcha 4.2.6 and Contact Form 4.0.3 returns the menu to working order. Please pass this on to your developers and scold them to respect WP internals, this is exactly why they are there!

    I already submitted a request via your help center but I received no response there.

    Hi,

    We’ll implement all the necessary changes in the nearest plugin update.

    Please let us know if you have any additional questions.

    Sincerely,
    BestWebSoft Support Team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘BWS Menu breaking my admin’ is closed to new replies.