Support » Plugin: Simple Share Buttons Adder » Last version (7.3.6) plugin gives error

  • Resolved belois

    (@belois)


    When we update the plugin Simple Share Buttons Adder to the latest version we get an error:
    Fatal error: Uncaught exception ‘Exception’ with message ‘Plugin dir is not inside of the wp-content directory’ in D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\php\class-plugin-base.php:165 Stack trace: #0 D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\php\class-plugin-base.php(71): SimpleShareButtonsAdder\Plugin_Base->locate_plugin() #1 D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\php\class-plugin.php(19): SimpleShareButtonsAdder\Plugin_Base->__construct() #2 D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\instance.php(19): SimpleShareButtonsAdder\Plugin->__construct() #3 D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\simple-share-buttons-adder.php(26): require_once(‘D:\\appdata\\IIS\\…’) #4 D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-settin in D:\appdata\IIS\vhosts\truckfestijnnijkerk.nl\httpdocs\wp-content\plugins\simple-share-buttons-adder\php\class-plugin-base.php on line 165

    With the older versions like 6.3.4 no problem

    • This topic was modified 2 years, 7 months ago by belois.
Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m having this same issue – it appears to be caused when running the plugin on Windows.

    I believe the problem is that around line 152 of class-plugin-base.php the plugin normalises filenames to use linux-style forward slashes, but then around line 162 continues to use \DIRECTORY_SEPARATOR which causes the parsing of the path to fail.

    		if ( '/' !== \DIRECTORY_SEPARATOR ) {
    			$file_name = str_replace( \DIRECTORY_SEPARATOR, '/', $file_name ); // Windows compat.
    		}

    $plugin_path = $this->relative_path( $plugin_dir, 'wp-content', \DIRECTORY_SEPARATOR );

    A temporary workaround is to simply replace the \DIRECTORY_SEPARATOR with '/' on line 162:

    $plugin_path = $this->relative_path( $plugin_dir, 'wp-content', '/' );

    This is liable to break when the plugin gets updated, however.

    • This reply was modified 2 years, 7 months ago by Patabugen.
    Plugin Author Simple Share

    (@davidoffneal)

    We apologize for this inconvenience. We will have this issue resolved in a subsequent release (7.3.7) later today. Thank you for your patients and feedback!

    Plugin Author Simple Share

    (@davidoffneal)

    Hi @belois & @patabugen,

    Thank you so much for your patience. We’ve recently updated the plugin to account for the error you’ve received. If you can please update the plugin and double check to see all is working well again that would be awesome.

    If you’re still seeing an issue please let us know and we’ll be sure to hop on it right away!

    Thanks again for your patience and great feedback.

    Works great again! Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Last version (7.3.6) plugin gives error’ is closed to new replies.