Git Product home page Git Product logo

wordpress-bundle's Introduction

Symfony WordPress Bundle

Build enterprise solutions with WordPress.

Latest Stable Version Total Downloads Latest Unstable Version License Buy us a tree Doc - Gitbook

The Symfony WordPress Backoffice Bundle is a powerful library that seamlessly combines the flexibility of Symfony, a robust PHP framework, with the user-friendliness of WordPress, a popular content management system (CMS).

This bundle enables you to harness Symfony's structure to develop highly customized web applications while using WordPress as the backend for content management. It simplifies the integration of WordPress into your Symfony project, allowing you to leverage the best of both worlds.

How does it work ?

When the WordPress bundle is loaded, it selectively includes the essential WordPress Core files required for utilizing WordPress functions and plugins within Symfony.

Example :

// src/Controller/BlogController.php

/**
 * @param Post $post
 * @param PostRepository $postRepository
 * @return Response
 */
public function pageAction(Post $post, PostRepository $postRepository)
{
    $context = [];
    
    // get current post
    $context['post'] = $post;
    
    // find 10 "guide" ordered by title
    $context['guides'] = $postRepository->findBy(['post_type'=>'guide'], ['title'=>'ASC'], 10);

    return $this->render('page.html.twig', $context);
}
{# templates/page.html.twig #}

{% extends 'layout.html.twig' %}

{% block body %}
<article id="post-{{ post.ID }}" class="entry {{ post.class }}">

    {% if post.thumbnail %}
        <img src="{{ post.thumbnail|resize(800, 600) }}" alt="{{ post.thumbnail.alt }}"/>
    {% endif %}

    <div class="entry-content">
        
        {{ post.content|raw }}
        
        {# or #}
        
        {% for block in post.blocks %}
            {% include 'block/'~block.name~'.html.twig' %}
        {% endfor %}
    </div>
    
    <small>{{ post.custom_fields.mention }}</small>
    
    {% for guide in guides %}
        {% include 'guide.html.twig' with {props:guide} %}
    {% endfor %}

</article>
{% endblock body %}

Documentation

Changelog

Please see Changelog for more information on what has changed recently.

Features

Using Composer :

  • Install/update WordPress via composer
  • Install/update plugins via composer

Using Symfony :

  • Twig template engine
  • Folder structure
  • Http Cache
  • Routing
  • YML configuration
  • DotEnv
  • Enhanced Security ( WordPress is 'hidden' )
  • Dynamic image resize
  • MVC

Using WordPress Bundle :

  • Post/Term/User Repository
  • Controller argument resolver for post(s), term, user and blog
  • Symfony Cache invalidation on update ( Varnish compatible )
  • Post/PostCollection/Image/Menu/Term/User/Comment/Blog/Block entity
  • Possible use of WordPress predefined routes
  • Site health checker url

Using WP Steroids WordPress plugin :

  • WordPress' configuration using yml ( view sample )
  • Permalink configuration for custom post type and taxonomy
  • Maintenance mode
  • Backup download in dev mode
  • Build hook
  • Disabled automatic update
  • Enhanced Security
  • Better guid using RFC 4122 compliant UUID version 5
  • Multisite images sync ( for multisite as multilangue )
  • SVG Support
  • Better Performance
  • WordPress Bugfix
  • CSS Fix
  • Multisite post deep copy ( with multisite-language-switcher plugin )
  • Custom datatable support with view and delete actions in admin
  • Google translate or Deepl integration
  • Optimisations

YML file allows to configure :

  • Image options
  • Maintenance support
  • Admin pages removal
  • WYSIWYG MCE Editor
  • Feature Support
  • Multi-site configuration
  • ACF configuration
  • Menu
  • Custom Post type
  • Custom Taxonomy
  • Block
  • Page, post, taxonomy template
  • Page state
  • Post format
  • External table viewer
  • Advanced roles

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Creating a new project

$ composer create-project metabolism/wordpress-skeleton my_project_directory

Please read the full bundle installation guide to continue

Setting up an existing Symfony project

Define installation path for WordPress core and plugins in composer.json

"extra": {
    "installer-paths": {
        "public/wp-bundle/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
        "public/wp-bundle/plugins/{$name}/": ["type:wordpress-plugin"],
        "public/wp-bundle/themes/{$name}/": ["type:wordpress-theme"],
        "public/edition/": ["type:wordpress-core"]
    }
}

Install the bundle

$ composer require metabolism/wordpress-bundle

For applications that don't use Symfony Flex

Register the bundle

// config/bundles.php

return [
    // ...
    Metabolism\WordPressBundle\WordPressBundle::class => ['all' => true],
];

Please read the full bundle installation guide to continue

Demo

https://github.com/metabolism/wordpress-bundle-demo

This is an implementation of the Twenty Nineteen WordPress theme for wordpress-bundle.

Screenshot from 2021-05-03 10-08-22

Recommended / tested plugins

  • Advanced custom fields Customise WordPress with powerful, professional and intuitive fields.
  • ACF extensions Extensions for ACF
  • Classic editor Restores the previous (« classic ») WordPress editor and the « Edit Post » screen.
  • WP smartcrop Set the 'focal point' of any image, right from the media library
  • Multisite language switcher Add multilingual support using a WordPress multisite
  • WordPress seo The favorite WordPress SEO plugin of millions of users worldwide!
  • Query monitor Query Monitor is the developer tools panel for WordPress
  • Redirection Easily manage 301 redirections, keep track of 404 errors
  • Contact form 7 Manage multiple contact forms, plus you can customize the form and the mail contents

Roadmap

  • More samples
  • Global maintenance mode for multi-site
  • Unit tests
  • Better type hinting

Drawbacks

WordPress' functions are available in the global namespace.

Some WordPress plugins may not work ( ex : Woocommerce ) or require extra works.

Treeware

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

License

The MIT License (MIT). Please see License File for more information.

wordpress-bundle's People

Contributors

adlpz avatar jerome-barbato avatar klehm avatar mvento avatar s9weber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordpress-bundle's Issues

License question and issue

The README.md says this is GPL 3.0 but the license file says this is AGPL. Why do you put that extremely restrictive license on a combination of Symfony - which is gratefully MIT licensed - and WordPress - which is GPLv2.0 licensed?

This makes a project which is essentially a great idea totally useless for any closed source project, even if it is a server-side application which also means growing the project and contribution is much less likely.

In doubt I must assume that the license is AGPL just as in the license file.

More information: https://softwareengineering.stackexchange.com/questions/107883/agpl-what-you-can-do-and-what-you-cant

Hooks and /edition/wp-login.php

Hello @wearemetabolism ,

Can you tell me if this statement is correct ?
Wordpress Hooks are not fired on /edition/wp-login.php

Thanks in advance
Tim

Catch-all controller action for custom post types

Hi Jerome,

Currently we have a minor issue with creating new post types, where we have to specify a new <myPostType>Action() in BlogController. Oftentimes, the methods are exactly the same, simply loading our single.html.twig template.

Would it be possible to add a catch-all method for custom post types? It would greatly reduce duplicate code in our blog controller. I guess this is also closely related to #37.

PS. thanks for creating this bundle, we're having a great time developing our CMS without having the messy project structure of Wordpress 👌

Gestion de l'openGraph via YoastSEO (et hook template redirect en général)

Le hook 'template_redirect' n'est pas appelé avant la création du context Twig, certaines données sont donc manquantes à Yoast pour générer les metas injectées dans le wp_head.

Pour corriger cela, il faudrait modifier src/Traits/ContextTrait.php pour ajouter le do_action('template_redirect') si ce n'est pas trop impactant pour la solution sinon appeler la fonction wpseo_frontend_head_init() si le module wordpress-seo (Yoast) est présent.

Solution de contournement, étendre du ContextTrait pour ajouter le do_action avant la création du context.

Modifying routing / exposing Permastruct class

Hi again,

Backstory: I was trying to modify my BlogController, spliting up our post type actions into multiple controllers (otherwise, the controllers tend to become quite large, having many different post types). Naturally, I tried adding new routes to my routing config, but these weren't properly integrated with the Wordpress rewrite system.

I saw that the Permastruct class in config/routing.php parses the Wordpress rewrites into Symfony routes (nice!). However, since the class is not located in the /src directory, I cannot autoload this in my own routing.php file... Maybe move it to src/Routing and import it into the config file?

Also, it would be great if we could configure which controllers handle certain (custom) content types. Here's a proposal:

new Permastruct($collection, '', [
    'custom-post_type' => CustomController,
    'post' => PostController,
    'page' => PageController,
    'default' => BlogController,
]);

Besides this, it would help to type-hint controller methods using some kind of bundle-exposed interface:

namespace Metabolism\WordpressBundle\Interface;

interface ControllerInterface {
    function postAction(Post $post);
    function archiveAction(array $posts, PaginationService $paginationService);
}

// Alternative: 
interface ControllerInterface {
    function show(Post $post);
    function index(array $posts, PaginationService $paginationService); // or achive() / list()
}

Maybe it would be even better if these method names could be specified by the user (like [CustomController::class, 'myOwnMethod'], giving a bit more more flexibility.

Would love to hear your thoughts!

Composer 2 support

Hi,

i'm using Symfony 5.4 and i tried to install the package, but i got this error:

Problem 1
- metabolism/wordpress-bundle 2.0.2 requires metabolism/wordpress-core-installer ^1.0 -> satisfiable by metabolism/wordpress-core-installer[1.0.0, 1.1.0, 1.1.1].
- metabolism/wordpress-bundle[2.0.0, ..., 2.0.1] require metabolism/wp-steroids 1.0.x-dev -> found metabolism/wp-steroids[1.0.x-dev] but it does not match your minimum-stability.
- metabolism/wordpress-core-installer 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
- metabolism/wordpress-core-installer[1.1.0, ..., 1.1.1] require composer/installers ^1.0 -> found composer/installers[v1.0.0, ..., v1.12.0] but the package is fixed to v2.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires metabolism/wordpress-bundle ^2.0 -> satisfiable by metabolism/wordpress-bundle[2.0.0, 2.0.1, 2.0.2].

Switching to composer v1 solve the issue.
Is there a way to get this bundle work with composer v2?

flush_rewrite_rules() is called on every page load

Hi there,

It seems like flush_rewrite_rules() is called on each page load here:

https://github.com/jerome-barbato/wordpress-bundle/blob/fae875be096443103edfab77e4f033ff8de969e6/config/routing.php#L191-L195

I believe wordpress clears the rewrites in the options table and then fills it with new values - it seems inefficient to do this on every page load :)

Maybe the code could be wrapped in APP_ENV / WP_ENV check, such that the flush only happens on a development environment.

User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\BundleInterface::getPath()" might add "string"

Just installed the wordpress-bundle-demo and got this message.

2022-01-13T16:57:55+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\BundleInterface::getPath()" might add "string" as a native return type declaration in the future. Do the same in implementation "Metabolism\WordpressBundle\WordpressBundle" now to avoid errors or add an explicit @return annotation to suppress this message.

With Symfony 6.0, the bundle will throw an error.

!!  
!!  Fatal error: Declaration of Metabolism\WordpressBundle\WordpressBundle::getPath() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getPath(): string in /Users/danielplatt/Sites/my_wp_demo/vendor/metabolism/wordpress-bundle/src/WordpressBundle.php on line 13
!!  PHP Fatal error:  Declaration of Metabolism\WordpressBundle\WordpressBundle::getPath() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getPath(): string in /Users/danielplatt/Sites/my_wp_demo/vendor/metabolism/wordpress-bundle/src/WordpressBundle.php on line 13
!!  Symfony\Component\ErrorHandler\Error\FatalError {#83
!!    #message: "Compile Error: Declaration of Metabolism\WordpressBundle\WordpressBundle::getPath() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getPath(): string"
!!    #code: 0
!!    #file: "./vendor/metabolism/wordpress-bundle/src/WordpressBundle.php"
!!    #line: 13
!!    -error: array:4 [
!!      "type" => 64
!!      "message" => "Declaration of Metabolism\WordpressBundle\WordpressBundle::getPath() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getPath(): string"
!!      "file" => "/Users/danielplatt/Sites/my_wp_demo/vendor/metabolism/wordpress-bundle/src/WordpressBundle.php"
!!      "line" => 13
!!    ]
!!  }
!!  

Configuration of the wp-admin path / preventing multiple reads from composer.json

  1. The WordPress admin path is currently hard-coded to public/edition/:

https://github.com/jerome-barbato/wordpress-bundle/blob/c74a9740816164b6f2239e7e0a8e1cf21ca1179f/src/Loader/ConfigLoader.php#L37-L39

Wouldn't it be a good idea to make this configurable, e.g. via the .env file?

  1. If the admin path is moved, the bundle will read the composer.json file (twice...!) Here's the first:

https://github.com/jerome-barbato/wordpress-bundle/blob/c74a9740816164b6f2239e7e0a8e1cf21ca1179f/src/Loader/ConfigLoader.php#L41-L43

And then again in WordpressBundle:

https://github.com/jerome-barbato/wordpress-bundle/blob/c74a9740816164b6f2239e7e0a8e1cf21ca1179f/src/WordpressBundle.php#L113-L116

This feels like it's quite inefficient - the program is reading and json_decoding the composer file twice, just to get the wp-admin path.

I have to say, I like that the bundle looks for the composer config, which reduces code duplication in the path configuration. Maybe this config step can be configured during the first load, and then cached using the Symfony memory/filesystem cache?

Add support for WP_ENVIRONMENT_TYPE

Hi Jerome,

Wordpress supports an 'env' setting via the WP_ENVIRONMENT_TYPE constant. Some plugins use this to change their behaviour on development sites. See https://developer.wordpress.org/reference/functions/wp_get_environment_type

Suggested addition:

// src/Loader/ConfigLoader.php

$env = env('APP_ENV') ?: (env('WP_ENV') ?: 'dev');

/**
 * Define basic environment
 */
+ define('WP_ENVIRONMENT_TYPE', $env === 'dev' ? 'development' : 'production');
define('WP_ENV', $env);
define('WP_DEBUG', $env === 'dev');
define('WP_DEBUG_DISPLAY', WP_DEBUG);
define('SCRIPT_DEBUG', WP_DEBUG);

Related to #40

Symfony 5 support

Installation is not possible if using the latest symfony command to create the project setup. It sets up the symfony project to v5.
Because of composer dependencies in the metabolism/package-actions which requires symfony/filesystem ^3.0 or ^4.0 but those packages are not found.

Process

  1. Run composer require metabolism/wordpress-bundle
  2. Command returned status (2) with error of missing dependencies
  3. User can't continue with the further installation

Expected result

installed composer package metabolism/package-actions to proceed further according to installation instructions

Current result

Install fails because of missing composer dependencies

Possible Fix

Update dependencies for metabolism/package-actions to use filesystem ^5.0

Cli dump

Using version ^1.4 for metabolism/wordpress-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.2.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - metabolism/wordpress-bundle 1.4.0 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.1 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.10 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.2 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.3 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.4 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.5 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.6 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.7 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.8 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.9 requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.4.x-dev requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/wordpress-bundle 1.5.x-dev requires metabolism/package-actions 1.1.* -> satisfiable by metabolism/package-actions[1.1.0, 1.1.1].
    - metabolism/package-actions 1.1.1 requires symfony/filesystem ~3.0 -> no matching package found.
    - metabolism/package-actions 1.1.0 requires symfony/filesystem ~4.0 -> no matching package found.
    - Installation request for metabolism/wordpress-bundle ^1.4 -> satisfiable by metabolism/wordpress-bundle[1.4.0, 1.4.1, 1.4.10, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.x-dev, 1.5.x-dev].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.
unable to run /usr/local/bin/composer require metabolism/wordpress-bundle: exit status 2```

Form Helper

Hi there,

could you please fix the Form Helper ?

Thanks

Redirect `wp-admin` to Wordpress admin

In Metabolism\WordpressBundle\Action\FrontAction, if the user visits /edition (or in our case, /cms), the page is nicely redirected to the Wordpress admin interface.

It would be nice if this could also redirect the page if a user visits /wp-admin (and maybe also sub-pages, like /wp-admin/upload.php), since most clients are used to visit this url when trying to access the Wordpress interface.

Erreurs sur la gestion des thèmes - Errors on the management of themes

Bonjour, et en premier super travail avec ce bundle bien utile.

Je dois porter à votre attention quelques problèmes :
-> via composer, l'installation de plugins fonctionne correctement, mais pas pour les thèmes :
les plugins sont bien installés dans public/wp-bundle/plugins, comme le fait également l'installation via Wordpress, pour les thèmes, il devrait les installer dans public/wp-bundle/themes. L'installation de thèmes via composer les installent dans wp-content/themes. L'installation via Wordpress elle ne fonctionne pas du tout.
De plus, le menu Appance ne contient pas l'accès à la gestion des thèmes (activation - désactivation - suppression - ajout) même si la page Php existe. Si l'on y accède par l'url : edition/wp-admin/themes.php, les thèmes sont recherché dans public/wp-bundle/themes, dossier qui l'existe pas.
Sous Linux en réalisant un lien symbolique en wp-content/themes (source) et public/wp-bundle/themes (cible), la page fonctionne et permet d'avoir le thème installé via composer. Toutefois, les thèmes installés de base dans public/edition/wp-content/themes ne sont pas pris en compte, comme le plugin akismet dans public/edition/wp-content/plugins.

Serait-il possible de faire que pour les plugins et les thèmes tout se passe dans le dossier public/wp-bundle ? Ceci dans le but de centraliser la gestion d'objets de même type. Et faire de ce fait pointer les recherches de la page Php edition/wp-admin/themes.php vers public/wp-bundle/themes ? Cela induit le transferts des fichiers présent dans les dossiers public/edition/wp-content/plugins et public/edition/wp-content/thèmes dans les dossiers correspondant dans public/wp-bundle.
Dans un second temps, serait-il possible d'avoir la même fonctionnalité pour les thèmes que l'existante pour les plugins : installation par composer ou via Wordpress sans erreur ?

Merci d'avance pour le temps que vous pourrez consacrer à cette demande.


Hello, and first great job with this useful bundle.

I have to bring to your attention a few issues:
-> via composer, the installation of plugins works correctly, but not for themes:
plugins are well installed in public/wp-bundle/plugins, as also does installation via Wordpress, for themes it should install them in public/wp-bundle/themes. Installing themes via composer installs them in wp-content/themes. The installation via Wordpress it does not work at all.
In addition, the Appance menu does not contain access to theme management (activation - deactivation - deletion - addition) even if the Php page exists. If you access it by the url: edition/wp-admin/themes.php, the themes are looked for in public/wp-bundle/themes, folder which does not exist.
Under Linux by making a symbolic link in wp-content/themes (source) and public/wp-bundle/themes (target), the page works and allows you to have the theme installed via composer. However, themes installed in public/edition/ wp-content/themes are not taken into account, such as the akismet plugin in public/edition/wp-content/plugins.

Would it be possible to make plugins and themes all go to the public/wp-bundle folder? This in order to centralize the management of objects of the same type. And thus make the searches of the page Php edition/wp-admin/themes.php point to public/wp-bundle/themes? This induces the transfer of the files present in the public/edition/wp-content/plugins and public/edition/wp-content/themes folders in the corresponding folders in public/wp-bundle.
Secondly, would it be possible to have the same functionality for themes as the existing one for plugins: installation by composer or via Wordpress without error?

Thank you in advance for the time you can devote to this request.

Cordialement,
Celtic34fr
Béziers - France

Symfony 4?

Any plans for Symfony 4 compatibility? Attempts to composer require metabolism/wordpress-bundle, even after adding https://wpackagist.org as a repository, in a fresh Symfony 4.3 installation results in

Your requirements could not be resolved to an installable set of packages.

Gutenberg Question

wp feature img not in gutenberg right column but there in classic editor?.

My misstake or not ?

regard

Set root domain url to wp homepage

I do not find the way to load the front page on the root domain (ex : https.//www.mydomain.com)
Instead I have a 404 page
image

When the wp reading setting are set on Your latest posts, the post load properly.

Best Regards

Logo, title, slogan: escaped chain that must not be

When I try to add a logo to the identity of Website, I have that :

<div class="site-logo">
    &lt;span class="custom-logo-link"&gt;&lt;img width="175" height="175" src="/uploads/2021/08/cropped-picto-rse.png" class="custom-logo" alt="" /&gt;&lt;/span&gt;
</div>

And when my slogan is : "c'est un test", the page return "c&#039;est un test"
All the string were escaped, when a raw string where needed.

to remove this bug you must add to the restitution of fields or function '| raw' in the source file templates / template-parts / header / site-branding.html.twig on lines 12, 17, 19, 25, 33 and 44 (logo, tiltle of site, slogan of site, mai_menu items et social_menu items).

Celtic34fr
Béziers - France

impossible d'installer metabolism/wordpress-bundle - can't install metabolism/wordpress-bundle

quand je tente d'installer metabolism/wordpress-bundle, j'ai le retour suivant :

`composer require metabolism/wordpress-bundle
Using version ^1.4 for metabolism/wordpress-bundle
./composer.json has been updated
Running composer update metabolism/wordpress-bundle
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- metabolism/wordpress-bundle[1.4.4, ..., 1.4.12] require metabolism/wordpress-core-installer 1.0.* -> satisfiable by metabolism/wordpress-core-installer[1.0.0].
- metabolism/wordpress-bundle[1.4.13, ..., 1.4.15] require metabolism/package-actions 1.2.* -> satisfiable by metabolism/package-actions[1.2.0, 1.2.1, 1.2.2, 1.2.3].
- metabolism/wordpress-bundle[1.4.0, ..., 1.4.3] require ext-posix * -> it is missing from your system. Install or enable PHP's posix extension.
- metabolism/wordpress-core-installer 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.2.0] but it does not match the constraint.
- metabolism/package-actions[1.2.0, ..., 1.2.3] require symfony/filesystem ^3.0|^4.0|^5.0 -> found symfony/filesystem[v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.37, v5.0.0, ..., v5.4.3] but the package is fixed to v6.0.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires metabolism/wordpress-bundle ^1.4 -> satisfiable by metabolism/wordpress-bundle[1.4.0, ..., 1.4.15].

To enable extensions, verify that they are enabled in your .ini files:
- H:\wamp64\bin\php\php8.0.13\php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-posix to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require metabolism/wordpress-bundle:*" to figure out if any version is installable, or "composer require metabolism/wordpress-bundle:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.`

=> je suis Sous >Windows 10 - composer 2.2.6 - WampServer 3.2.7 - PHP/8.0.13

Après recherche, ext-posix ou toute extension posix pour Php n'existe pas pour Windows .... que faire alors ?


When I try to install metabolism/wordpress-bundle, I get the following return:

`composer require metabolism/wordpress-bundle
Using version ^1.4 for metabolism/wordpress-bundle
./composer.json has been updated
Running composer update metabolism/wordpress-bundle
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- metabolism/wordpress-bundle[1.4.4, ..., 1.4.12] require metabolism/wordpress-core-installer 1.0.* -> satisfiable by metabolism/wordpress-core-installer[1.0.0].
- metabolism/wordpress-bundle[1.4.13, ..., 1.4.15] require metabolism/package-actions 1.2.* -> satisfiable by metabolism/package-actions[1.2.0, 1.2.1, 1.2.2, 1.2.3].
- metabolism/wordpress-bundle[1.4.0, ..., 1.4.3] require ext-posix * -> it is missing from your system. Install or enable PHP's posix extension.
- metabolism/wordpress-core-installer 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.2.0] but it does not match the constraint.
- metabolism/package-actions[1.2.0, ..., 1.2.3] require symfony/filesystem ^3.0|^4.0|^5.0 -> found symfony/filesystem[v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.37, v5.0.0, ..., v5.4.3] but the package is fixed to v6.0.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires metabolism/wordpress-bundle ^1.4 -> satisfiable by metabolism/wordpress-bundle[1.4.0, ..., 1.4.15].

To enable extensions, verify that they are enabled in your .ini files:
- H:\wamp64\bin\php\php8.0.13\php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-posix to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require metabolism/wordpress-bundle:*" to figure out if any version is installable, or "composer require metabolism/wordpress-bundle:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.`

=> I am under Windows 10 - composer 2.2.6 - WampServer 3.2.7 - PHP/8.0.13

After searching, ext-posix or any posix extension for Php does not exist for Windows....what to do then?

Gilbert ARMENGAUD
Celtic34fr
Béziers - Occitanie - France

ArticleAction - for blog page

Hi, I do not find the way to call the articleAction function for the blog page.

The Front and blog page and set in the reading wp backend.

The frontAction load correctly like this ,
if( is_user_logged_in() ){ $context->add('section', 'Homepage for logged in user'); } $context->add('section', 'Homepage'); return $this->render('homepage.html.twig', $context->toArray());

but not the articleAction

public function articleAction(Context $context) { $context->add('section', 'article'); $context->addPosts(['category__and' => [1,3], 'posts_per_page' => 2, 'orderby' => 'title'], 'portraits'); $context->addSitemap(); $context->addPagination(); return $this->render('page/articles.html.twig', $context->toArray()); }

I need to use a function like this in the blog controller to check if the page is the blog page

function is_blog () { global $post; $posttype = get_post_type($post ); return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; }

I have miss something ?

There is not the is_blog_page in the debug context
image

Regards

Permission problem when uploading media files

Hi guys, great work. Im able to do many things with the bundle for now, but when i intend to upload an image to my post the admin panel shows permission to write folder:

Unable to create directory ../uploads/2020/02. Is its parent directory writable by the server?

What directory is the one that i need to give access to?

the folder structure that i guess the folder uploads should live is as follows:

/public
/public/edition
/public/uploads
/public/edition/wp-content/uploads

i dont know where else should i give permission to
i am on ubuntu 1804
the command im trying is chmod -R 777 ./ on the folders i listed

can you help?

Help about AdminAction

Hi there,
Can you provide an example on how to create an admin menu page from the AdminAction class?

My goal at the end is to create a CRUD section in the Wordpress admin for an "external" entity (created with sf/doctrine).

Thanks in advance.

Add support for `DISALLOW_FILE_MODS` to prevent plugin updates

Hi Jerome,

Since we are using CI/CD to update our wp core and plugins (via composer), our users shouldn't be able to edit or install plugins. It seems possible to disable plugin installs via the DISALLOW_FILE_MODS constant.

Could you add support for this constant in Metabolism\WordpressBundle\Loader\ConfigLoader? Maybe it could also be integrated with the .env file or via the WP Steroids plugin?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.