Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LevyImage

    (@levyimage)

    I think this may be the problem:

    //Plugin name
    if (!defined('CB_LIMIT_POSTS_PLUGIN_NAME')) {
        define('CB_LIMIT_POSTS_PLUGIN_NAME', trim(dirname(plugin_basename(__FILE__)), '/'));
    }
    
    // Plugin url
    if (!defined('CB_LIMIT_POSTS_PLUGIN_URL')) {
        define('CB_LIMIT_POSTS_PLUGIN_URL', WP_PLUGIN_URL . '/' . CB_LIMIT_POSTS_PLUGIN_NAME);
    }
    
    .............
    
    public function enqueueScripts(){
    		wp_enqueue_script('cb_limit_posts_js', CB_LIMIT_POSTS_PLUGIN_URL . '/js/LimitPosts.js', array('jquery'));
    		wp_enqueue_style('cb_limit_posts_css', CB_LIMIT_POSTS_PLUGIN_URL . '/css/limitposts.css');
    }

    most plugins don’t declare their file locations this way, and I believe it’s the cause for the 404 errors.

    Thread Starter LevyImage

    (@levyimage)

    I fixed the issue by changing the following and removing all opening slashes on file location declares:

    // Plugin url
    if (!defined('CB_LIMIT_POSTS_PLUGIN_URL')) {
        define('CB_LIMIT_POSTS_PLUGIN_URL', plugin_dir_url( __FILE__ ));
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Failed to load resources on Limit Posts settings page’ is closed to new replies.