Composer generates the autoloader for you. Thus, you don’t need to require a specific file from vendor packages. All you need to do is require the composer autoloader:
Change require_once dirname(__FILE__) . '/vendor/Frozensheep/RightmoveADF/RightmoveADF.php';
to
require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
In some cases, classes still not be found. Re-generate the composer autoloader by $ composer dump-autoload
.
Usually, you should not mess with the vendor
directory. If you did, I suggest you remove the vendor
directory and re-install packages by $ rm -dr vendor/
and $ composer install
Related Posts:
- Deploying WordPress with Composer
- Deploying WordPress with Bedrock/Capistrano on Siteground – Composer returns “text/html” message
- Include Carbon Fields via Composer with Mozart [closed]
- Use Composer Package inside class – Namespacing error
- How to install WPMU with composer?
- How to properly use composer packages in wordpress?
- Composer fails to download PHP Codesniffer to plugin
- Debugging deprecated/renamed PSR-0 classes being requested
- How to prevent Composer dependency conflicts amongst WP plugins?
- add_action in namespace not working
- Why include a composer.json file with my plugin?
- Autoloading in Child Theme
- Using composer for dependency management in plugindevelopment
- Namespacing WordPress project according to FIG standards
- Implementing namespaces in plugin template
- WordPress with composer, how to handle updates?
- Use composer to load custom classes [closed]
- How to use defined in class file with namespace
- Install wordpress using composer in a specific language
- How can I have case-sensitive theme directory names when installed with Composer?
- In a continuous integration environment how do you implement the database entries for plugins and themes
- WordPress with Composer and different plugins for dev/live.
- Change name of custom post type archive
- Sage WordPress – Plugin Namespace: Not Found
- Namespaces declared by a theme/plugin should start with the theme/plugin prefix. Found: “eustatos\test_plugin”
- How to provide a plugin which requires CMB2 (plugin dependencies)?
- Ran into a problem installing plugins with Composer
- How to reference a function from a class in a different file which is also namespaced?
- Using WordPress gettext functions in a library outside plugin or theme scope
- WordPress composer issues
- How do I configure wordpress structure for development using git and composer
- Why namespaces are rarely used in WordPress plugins?
- How to use WordPress methods (themes, plugins, context) with Behat?
- Access WP_REST_Server from within plugin namespace
- REST route from a plugin not working if WordPress is installed in a subdirectory
- Autoloader not finding classes from my plugin
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- How do I define and register a shortcode function in a namespaced functions.php file?
- Getting wp_timezone undefined within a namespace
- composer not working on my plugin when i upload it to my website
- Plugin development and composer
- Override plugin class which has namespace
- Problem with autoloader and namespaces
- wp_localize_script() and JavaScript namespaces
- How can I search all plugins for composer’s vendor/autoload.php?
- Composer setup-config.php not found
- Wp-CLI not working with WordPress installed with composer
- add_action in namespace not working
- WooCommerce custom product type not saving with namespaces
- Does the namespace always have to be prefixed to the function or class when referencing callbacks in WordPress, even when they are in the same file?
- WordPress Bedrock breaking plugin links
- How to handle theme activation errors?
- How to call a WP Class inside my theme
- local wordpress multisite not working on AWS development server “error establishing database connection”
- Why does wp_die() not work when inside a namespace?
- WordPress visual composer backend editor not showing
- Hiding class namespace from plugin’s extensions
- Update body class based on theme as well as a html attribute
- Custom Rest API namespace and endpoints are responding with 404 & 503 errors
- worldpay class not working with namespace in WordPress
- Reorganization of namespaces
- How to update WP-CLI on Windows via Composer?
- How to install WordPress with Composer?
- Is there any performance difference between duplicating composer packages among multiple plugins and not doing it? How can I avoid it?
- How to add a php package to an existing wordpress website
- How do I package and distribute my WordPress plugin via git?