• Hello,

    we had some issues with wrong paths in plugins and we tracked it down to usage of the WP_PLUGIN_URL. The usage of this constant is discouraged by WordPress and plugins_url() call should be used instead.

    I made a simple patch, which fixes this in the advanced-post-slider. I reused the existing advps_url constant, so the patch should not be less effective than the original implementation.

    — advanced-post-slider.php.orig 2015-08-20 16:41:30.383336763 +0200
    +++ advanced-post-slider.php 2015-08-20 16:57:30.735836107 +0200
    @@ -19,7 +19,7 @@
    require ‘advps-admin.php’;
    }

    – define(‘advps_url’,WP_PLUGIN_URL.”/advanced-post-slider/”);
    + define(‘advps_url’,plugins_url(‘/’,__FILE__));

    require ‘advps-db.php’;

    @@ -61,8 +61,8 @@

    /* —————————————————————————————*/

    – register_activation_hook(WP_PLUGIN_DIR.’/advanced-post-slider/advanced-post-slider.php’,’set_advps_options’);
    – register_deactivation_hook(WP_PLUGIN_DIR.’/advanced-post-slider/advanced-post-slider.php’,’unset_advps_options’);
    + register_activation_hook(advps_url.’advanced-post-slider.php’,’set_advps_options’);
    + register_deactivation_hook(advps_url.’advanced-post-slider.php’,’unset_advps_options’);

    function unset_advps_options(){

    https://ww.wp.xz.cn/plugins/advanced-post-slider/

The topic ‘version 2.3.4 patch – correct plugin path construction’ is closed to new replies.