Git Product home page Git Product logo

polylang-cli's People

Contributors

diggy avatar szepeviktor 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

Watchers

 avatar  avatar  avatar  avatar

polylang-cli's Issues

FEATURE: test language existence

Hello @diggy,
As I told you in a different post, I use your package with Ansible. The problem that I encounter is that If I run wp pll lang delete --all or wp pll lang list --format=count, I get an error. In my ansible task, I would like to delete languages if they exist before adding other languages.
So would it be possible to have a flag to perform a delete even if there are no languages or at least return 0 instead of an error if I try to list the languages with format=count ?

Command to set the license for polylang pro

Hi,

I'm using the pro version of polylang and i'm willing to set the license through the wp-cli but the option doesn't appear after:

wp pll option list

In fact, this option is under another namespace
wp option list | grep license

polylang_licenses

Is there anyway to handle that ?

Thanks!

When the package is activated WP CLI is not assigning posts to the default language

By default when you use WP CLI it will assign the post to the default language.

So for example if I have Norsk and Finish and Norsk is set as default, if I run this command: wp post create --post-content="test" --post_status="publish" --post_title="test" I expect the post to be assigned to Norsk language.

But when I activate the Polylang-CLI package then when I use standard WP CLI the post is no longer assigned to the default language.

In my opinion the expected behaviour should be that a 3rd party package should not affect the standard WP CLI in any way.

Installation

Hello,
First of all, thank you for your work.
I'd like to install your package but I encounter some problems.
If I try : wp package install diggy/polylang-cli
I get : Error: Invalid package
And with : wp package install [email protected]:diggy/polylang-cli.git
I get : PHP Fatal error: require(): Failed opening required '/root/.wp- cli/packages/vendor/diggy/polylang-cli/vendor/autoload.php'.
What is the right way to do it ? Thank you very much.

Cannot be installed with wp-cli 2.2.0 out of the box

Hey there,

i would like to try out your very promising package, as the developers of polylang obviously do not yet have any interest in providing a CLI interface.

However when trying to install the pakcage, i get the following errors:

wp package install [email protected]:diggy/polylang-cli.git

Installing package diggy/polylang-cli (dev-master)
Updating /home/www-data/.wp-cli/packages/composer.json to require the package...
Registering [email protected]:diggy/polylang-cli.git as a VCS repository...
Using Composer to install the package...
 
Loading composer repositories with package information
Updating dependencies
Resolving dependencies through SAT

Dependency resolution completed in 0.016 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
    - Conclusion: remove wp-cli/wp-cli 2.2.0
    - diggy/polylang-cli dev-master requires wp-cli/wp-cli ~1.5.0 -> satisfiable by wp-cli/wp-cli[v1.5.0, v1.5.1].
    - diggy/polylang-cli dev-master requires wp-cli/wp-cli ~1.5.0 -> satisfiable by wp-cli/wp-cli[v1.5.0, v1.5.1].
    - Can only install one of: wp-cli/wp-cli[v2.2.0, v1.5.0].
    - Can only install one of: wp-cli/wp-cli[v2.2.0, v1.5.1].
    - Installation request for wp-cli/wp-cli 2.2.0 -> satisfiable by wp-cli/wp-cli[2.2.0].
    - Installation request for diggy/polylang-cli dev-master -> satisfiable by diggy/polylang-cli[dev-master].
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements ablocking the update you have to resolve those problems.
 
Error: Package installation failed (Composer return code 2).
Reverted composer.json.

Do you know how to fix this, so the future users can enjoy your tool even with the newest version of wp-cli?
Did you ever think about submitting your polylang-cli project to the official polylang project? I think this would be really useful and maybe they would take over the maintenance for you also .:)

Greetings!

FEATURES : wp pll post create, wp pll post bind

Hello @diggy,

Won't it be a good idea to offer the possibility to create posts in a specific language and link them?

  1. wp pll post create would look like wp post create but with the ability to pass the language.
  2. wp pll post bind would mimic pll_save_post_translations to bind posts created in 1.

My use case is to generate for every new website a basic structure with some pages ( Home, Contact, Blog, ... ) that are available in English and French by default and then add Home as frontpage with wp option update page_on_front. This currently doesn't work because, in order to update the option, polylang checks that the given id is translated and bound to a translation in every language.

fix `pll lang url` failing test

cf. #61

    When I run `wp pll lang url nl`                               # features/steps/when.php:29
    Then STDOUT should contain:                                   # features/steps/then.php:15
      """
      http://example.com/?lang=nl
      """
      $ wp pll lang url nl
      http://example.com/
      
      exit status: 0

Document alternative solution

This enables Polylang thus all posts can be managed, e.g. by wp post list

~/.wp-cli/commands/polylang-enable/command.php

<?php

if ( ! defined( 'PLL_ADMIN' ) ) define( 'PLL_ADMIN', true );
if ( ! defined( 'PLL_SETTINGS' ) ) define( 'PLL_SETTINGS', true );

~/.wp-cli/config.yml

require:
  - commands/polylang-enable/command.php

Please consider mentioning it. It took me 20 minutes to find out.

Undefined index: hook_suffix in `wp pll string list`

PHP Notice:  Undefined index: hook_suffix in /usr/local/var/www/vhosts/localhost/pll/wp-admin/includes/class-wp-screen.php on line 229
PHP Stack trace:
PHP   1. {main}() /usr/local/Cellar/wp-cli/1.3.0/php/boot-fs.php:0
PHP   2. include_once() /usr/local/Cellar/wp-cli/1.3.0/php/boot-fs.php:17
PHP   3. WP_CLI\bootstrap() /usr/local/Cellar/wp-cli/1.3.0/php/wp-cli.php:23
PHP   4. WP_CLI\Bootstrap\LaunchRunner->process() /usr/local/Cellar/wp-cli/1.3.0/php/bootstrap.php:75
PHP   5. WP_CLI\Runner->start() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Bootstrap/LaunchRunner.php:23
PHP   6. WP_CLI\Runner->_run_command() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Runner.php:985
PHP   7. WP_CLI\Runner->run_command() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Runner.php:330
PHP   8. WP_CLI\Dispatcher\Subcommand->invoke() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Runner.php:323
PHP   9. call_user_func:{/usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/Subcommand.php:401}() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/Subcommand.php:401
PHP  10. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/Subcommand.php:401
PHP  11. call_user_func:{/usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/CommandFactory.php:81}() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/CommandFactory.php:81
PHP  12. Polylang_CLI\Commands\StringCommand->list_() /usr/local/Cellar/wp-cli/1.3.0/php/WP_CLI/Dispatcher/CommandFactory.php:81
PHP  13. PLL_Table_String->__construct() /usr/local/var/www/vhosts/localhost/pll/vendor/diggy/polylang-cli/src/Commands/String.php:65
PHP  14. PLL_Table_String->__construct() /usr/local/var/www/vhosts/localhost/pll/wp-content/plugins/polylang/settings/table-string.php:25
PHP  15. convert_to_screen() /usr/local/var/www/vhosts/localhost/pll/wp-admin/includes/class-wp-list-table.php:143
PHP  16. WP_Screen::get() /usr/local/var/www/vhosts/localhost/pll/wp-admin/includes/template.php:2054

fix `wp pll doctor language`

$ wp pll doctor language
Searching for updates...
Error: 'language' is not a registered subcommand of 'core'. See 'wp help core'.
$ wp cli version
WP-CLI 1.3.0

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.