Questions tagged [autoloading]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

Adding google fonts to WordPress theme

I am trying to add google fonts to a custom WordPress theme. Therefore I tried to enqueue selected three font faces at once to make it fast loading. So, I use the below codes to register and enqueue ...
user avatar
1 vote
1 answer
38 views

WP Optimization: Removing Orphaned wp_options (especially the autoload ones)

Is there no mechanism which purges old options from the DB? I tried a few plugins in the past and I found out that there are a few pretty long option strings which are set to autoload but IMHO not ...
user avatar
  • 152
0 votes
0 answers
11 views

WP Optimization: Overwriting options to autoload=yes for often used options?

I'm currently trying to optimize my WP-page. I checked with "Query Monitor" and I see a lot of options which are fetched on every pageload (not a huge runtime cumulated, but still ~15-20 ...
user avatar
  • 152
0 votes
0 answers
19 views

Class 'Jetpack_Options' not found, composer dump-autoload not helping

I am cloning a friends WP installation using mysqldump, rsync and docker to fetch all files and data. When running the site, I get the following error: Fatal error: Uncaught Error: Class '...
user avatar
  • 125
0 votes
1 answer
91 views

Include Carbon Fields via Composer with Mozart [closed]

Coen Jacobs' Mozart is a tool to prevent namespace conflicts in Wordpress themes/plugins which utilize Composer for dependency management. It's similar to PHP Scoper but is described as simpler and ...
user avatar
  • 497
1 vote
0 answers
64 views

Connect Wordpress with SharePoint [closed]

I'm new here and I'm also new to WordPress. I'm currently trying to connect my WP site to SharePoint and I'm stuck. My approach to solve this was to search for php libraries that would help me with ...
user avatar
0 votes
1 answer
284 views

How to call a WP Class inside my theme

I wrote a WP theme using namespaces and autoload. Everything went smooth until I started to use WP classes which I understand of course because I understand how namespacing works. My question is, is ...
user avatar
0 votes
1 answer
390 views

Autoloading Classes in Plugins

In a custom WordPress plugin I have a folder /classes with about 20 classes. Classes sometimes change, come and go. I want all those classes from the folder to be loaded automatically. No my idea was ...
user avatar
  • 495
0 votes
1 answer
38 views

BuddyPress and namespacing

I'm using PSR-4 autoloading and namespacing for a new plugin. However, because my plugin is namespaced (and all it's classes are), I can't seem to extend a BuddyPress class (BP_Attachment) ...
user avatar
0 votes
1 answer
153 views

Problem with autoloader and namespaces

I'm writing a simple plugin with oop and using namespaces and autoloading. Here is my main file: add_action('plugins_loaded', array(My_Test_Plugin::get_instance(), 'plugin_setup')); class ...
user avatar
  • 325
0 votes
1 answer
983 views

Autoloader not finding classes from my plugin

I am trying to work with autoloader in my plugin. In the main file of my plugin I have use My_Plugin\Includes; require_once( plugin_dir_path( __FILE__ ) . 'includes/class-autoloader.php' ); $...
user avatar
  • 1,904
1 vote
0 answers
25 views

Widgets Scripts don't load - but load when I reload the page

I've recently made my website and added facebook web plugin script and instagram script on the widget bar. But when I go from the Homepage to another Page it's not loading. It's just loading when I ...
user avatar
0 votes
1 answer
53 views

Reorganization of namespaces

First of all thank You for Your time. I use autoload in my 2 plugins. They have to different namespaces but i want to build one main plugin with autoload for this two plugins. In future i am going to ...
user avatar
6 votes
1 answer
1k views

Autoloading in Child Theme

I'm trying to autoload the vendor/autoload.php from my parent theme into my child theme. heres what i have tried but to no avail: function beast_theme_setup() { $var1 = get_theme_root_uri() . '/...
user avatar
  • 113