Custom Fields
Re-Envisioned
Support Meta Box AIO Meta Box AIO requires Meta Box to work. Please install and activate it.

  • Creator
    Topic
  • #27031
    Resolved Maxim Gladines
    Participant

    I'm managed my site through bedrock and use composer to manage plugins. The Meta box AIO and meta box plugins are autoloaded as mu-plugins. It looks like both are installed correctly. However, I keep getting the notification "Meta Box AIO requires Meta Box to work. Please install and activate it." Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #27045
    Long Nguyen
    Moderator

    Hi Maxim,

    Please follow this documentation to know how to install Meta Box and other extensions via Composer https://docs.metabox.io/extensions/composer/.

    Let me know if the message still appears.

    #27051
    Maxim Gladines
    Participant

    Hi, thanks for ther reply.
    I'm pretty confident I did it correctly - have a look at my screen here

    Composer file below (removed my API key)

    <div>
    {
    "name": "roots/bedrock",
    "type": "project",
    "license": "MIT",
    "description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
    "homepage": "https://roots.io/bedrock/",
    "authors": [
    {
    "name": "Scott Walkinshaw",
    "email": "scott.walkinshaw@gmail.com",
    "homepage": "https://github.com/swalkinshaw"
    },
    {
    "name": "Ben Word",
    "email": "ben@benword.com",
    "homepage": "https://github.com/retlehs"
    }
    ],
    "keywords": [
    "bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
    ],
    "support": {
    "issues": "https://github.com/roots/bedrock/issues",
    "forum": "https://discourse.roots.io/category/bedrock"
    },
    "repositories": [
    {
    "type": "composer",
    "url": "https://wpackagist.org",
    "only": ["wpackagist-plugin/", "wpackagist-theme/"]
    },{
    "type": "composer",
    "url": "https://packages.metabox.io/XXX"
    }
    ],
    "require": {
    "php": ">=7.1",
    "composer/installers": "^1.10",
    "vlucas/phpdotenv": "^5.3",
    "oscarotero/env": "^2.1",
    "roots/bedrock-autoloader": "^1.0",
    "roots/wordpress": "5.7",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.0.0",
    "wpackagist-plugin/meta-box": "dev-trunk",
    "meta-box/meta-box-aio": "dev-master",
    "wpackagist-plugin/activecampaign-subscription-forms":"dev-trunk",
    "yoast/wordpress-seo": "dev-master"
    },
    "require-dev": {
    "squizlabs/php_codesniffer": "^3.5.8",
    "roave/security-advisories": "dev-master"
    },
    "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "extra": {
    "installer-paths": {
    "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin", "wpackagist-plugin/meta-box", "meta-box/meta-box-aio"],
    "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
    "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
    },
    "scripts": {
    "post-root-package-install": [
    "php -r \"copy('.env.example', '.env');\""
    ],
    "test": [
    "phpcs"
    ]
    }
    }

    </div>

    #29126
    MassimoMarazzi
    Participant

    Same problem here, i use composer without bedrock but when activate plugin i get notice that meta-box is required, but it is installed trought composer
    here my composer.json

    {
      "repositories":[
        {
          "type": "composer",
          "url": "https://wpackagist.org"
        },
        {
          "type": "composer",
          "url": "https://packages.metabox.io/KEY"
        }
      ],
      "require": {
        "wpackagist-plugin/meta-box":"^5",
        "meta-box/meta-box-aio": "dev-master",
        "composer/installers": "^1",
        "yahnis-elsts/plugin-update-checker": "^4"
      },
      "extra": {
        "installer-paths": {
          "vendor/meta-box/meta-box": ["wpackagist-plugin/meta-box"],
          "vendor/meta-box/{$name}/": ["type:wordpress-plugin"]
        }
      },
      "autoload": {
        "files": [
          "vendor/meta-box/meta-box/meta-box.php",
          "vendor/meta-box/meta-box-aio/meta-box-aio.php"
        ]
      }
    }
    
    #29128
    MassimoMarazzi
    Participant

    I resolved. I removed TGMPA from metabox-AIO with this steps:

    Remove action add_action( 'tgmpa_register', [$this, 'require_plugins'] );
    inside MBAIO\Plugin

    with this function

    function remove_hook_for_anonymous_class(
        $hook_name = '',
        $class_name = '',
        $method_name = '',
        $priority = 10
    ) {
        global $wp_filter;
    
        // Take only filters on right hook name and priority
        if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) ||
             ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
            return false;
        }
    
        foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
            if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
                if ( is_object( $filter_array['function'][0] ) &&
                     get_class( $filter_array['function'][0] ) &&
                     get_class( $filter_array['function'][0] ) == $class_name &&
                     $filter_array['function'][1] == $method_name ) {
                    if ( is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
                        unset( $wp_filter[ $hook_name ]->callbacks[ $priority ][ $unique_id ] );
                    } else {
                        unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
                    }
                }
            }
        }
        return false;
    }

    Then i call remove_hook_for_anonymous_class

    in main plugin file:

    remove_hook_for_anonymous_class( 'tgmpa_register', 'MBAIO\Plugin', 'require_plugins' );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.