ben@odin /v/w/tcpinball.org [1]> wp plugin auto-updates enable wp-api-privacy 0.450s
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /var/www/tcpinball.org/wp-content/object-cache.php:2499
Stack trace:
#0 /var/www/tcpinball.org/wp-includes/option.php(612): wp_cache_get()
#1 /var/www/tcpinball.org/wp-includes/option.php(164): wp_load_alloptions()
#2 /var/www/tcpinball.org/wp-includes/l10n.php(63): get_option()
#3 /var/www/tcpinball.org/wp-includes/l10n.php(165): get_locale()
#4 /var/www/tcpinball.org/wp-includes/l10n.php(1340): determine_locale()
#5 /var/www/tcpinball.org/wp-includes/l10n.php(1385): _load_textdomain_just_in_time()
#6 /var/www/tcpinball.org/wp-includes/l10n.php(194): get_translations_for_domain()
#7 /var/www/tcpinball.org/wp-includes/l10n.php(306): translate()
#8 /var/www/tcpinball.org/wp-content/object-cache.php(796): __()
#9 /var/www/tcpinball.org/wp-content/object-cache.php(2356): WP_Object_Cache::has_sqlite()
#10 /var/www/tcpinball.org/wp-includes/load.php(868): wp_cache_init()
#11 /var/www/tcpinball.org/wp-settings.php(146): wp_start_object_cache()
#12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1363): require('...')
#13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1282): WP_CLI\Runner->load_wordpress()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
#16 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#17 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
#18 /usr/local/bin/wp(4): include('...')
#19 {main}
thrown in /var/www/tcpinball.org/wp-content/object-cache.php on line 2499
Fatal error: Uncaught Error: Call to a member function get() on null in /var/www/tcpinball.org/wp-content/object-cache.php:2499
Stack trace:
#0 /var/www/tcpinball.org/wp-includes/option.php(612): wp_cache_get()
#1 /var/www/tcpinball.org/wp-includes/option.php(164): wp_load_alloptions()
#2 /var/www/tcpinball.org/wp-includes/l10n.php(63): get_option()
#3 /var/www/tcpinball.org/wp-includes/l10n.php(165): get_locale()
#4 /var/www/tcpinball.org/wp-includes/l10n.php(1340): determine_locale()
#5 /var/www/tcpinball.org/wp-includes/l10n.php(1385): _load_textdomain_just_in_time()
#6 /var/www/tcpinball.org/wp-includes/l10n.php(194): get_translations_for_domain()
#7 /var/www/tcpinball.org/wp-includes/l10n.php(306): translate()
#8 /var/www/tcpinball.org/wp-content/object-cache.php(796): __()
#9 /var/www/tcpinball.org/wp-content/object-cache.php(2356): WP_Object_Cache::has_sqlite()
#10 /var/www/tcpinball.org/wp-includes/load.php(868): wp_cache_init()
#11 /var/www/tcpinball.org/wp-settings.php(146): wp_start_object_cache()
#12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1363): require('...')
#13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1282): WP_CLI\Runner->load_wordpress()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process()
#16 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#17 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
#18 /usr/local/bin/wp(4): include('...')
#19 {main}
thrown in /var/www/tcpinball.org/wp-content/object-cache.php on line 2499
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
Looks like the global is not initialized at this point in the WP-CLI call stack
]]>Fatal error: Uncaught ArgumentCountError: Too few arguments to function Imagify\Bulk\Bulk::run_generate_nextgen(), 1 passed in /htdocs/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php on line 19 and exactly 2 expected in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php:223
Stack trace: 0 /htdocs/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php(19): Imagify\Bulk\Bulk->run_generate_nextgen() 1 [internal function]: Imagify\CLI\GenerateMissingNextgenCommand->__invoke() 2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func() 3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}() 4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(488): call_user_func() 5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php on line 223
Can you help list down all the wp cli commands that are related to w3 like
“wp w3-total-cache flush all”
Do you have it separately only for page, browser, object, cdn, opcode cache?
Please advise.
Thank you
]]>__construct
method for check_if_blocksy_is_activated()
, and at the top of that function is a check to see if the request is coming from WPCLI:
public function check_if_blocksy_is_activated() {
if (defined('WP_CLI') && WP_CLI) {
return false;
}
When coming from WPCLI, the check fails, which then fails to run the following init hook, which includes the loading of the WPCLI commands:
// Fails here, does not continue.
if (! $this->check_if_blocksy_is_activated()) {
return;
}
$this->early_init_with_blocksy_theme();
// This init loads the WPCLI commands, but is never reached.
add_action('init', [$this, 'init'], 0);
Commenting out the if (defined('WP_CLI')...
code then allows the WP CLI commands to be registered and available to use. I would recommend this snippet get removed, and then also add annotations for how the WP CLI commands work.
wp post delete $(wp post list –post_type=’post’ –name=hello-world –format=ids) –force && wp post delete $(wp post list –post_type=’page’ –name=sample-page — format=ids) –force && wp post create – -post_type=page –post_status=publish — post_title=”Home” && wp post create –post_type=page –post_status=publish — post_title=”Blog” && wp term update category 1 –name=Various — slug=various && wp option update timezone_string “Europe/Rome” && wp language core install it_EN && wp site switch-language it_EN && wp option update show_on_front page && wp option update page_on_front $ (wp post list – -post_type=’page’ –name=home –format=ids) && wp option update page_for_posts $(wp post list –post_type=’page’ –name=blog –format=ids) && wp option update rss_use_excerpt 1 && wp option update blog_public 0
but unfortunately I get the following errors:
parameter unknown –post_type
unknown –parameter name
unknown –parameter format
I point out that:
1) I am using windows 10;
2) I am using the code locally with the help of: LOCAL
Translated with www.DeepL.com/Translator (free version)
]]>I’m new to WordPress (but not new to website development, been doing that since the 90s!). I decided I wanted to set the site up locally using Local (by Flywire) and downloaded WordPress. When I got to the screen I put in a WordPress Username, password and… STUPIDLY left the WordPress Email bit with what was the default, which was something I hadn’t seen before so I assumed it was some kind of email I had to use: [email protected]
In hindsight, I should have deleted that .local email address and put in my real email.
Anyhow, I’ve spent the past two weeks building the site, learning everything, using plugins, it’s been a steep learning curve, using child themes for the first time and relying heavily on Chat GPT to talk me through the basics. And I’m now getting ready to finish the website and eventually export it.
But this is where I keep getting issues. For example, I get errors when creating Contact Forms, configuration errors because I am putting my real email address in because I obviously don’t want emails going to [email protected] because I don’t know where those emails are going.
But every time I try and change the Admin email, it just stays in pending. If I go to Users, the email is of course listed as this bizarre [email protected] and I put in that I want to change it to my real email address [email protected], a message says “If you change this, an email will be sent at your new address to confirm it.?The new address will not become active until confirmed.“
But no email ever arrives to confirm it! It just says “There is a pending change of your email to [email protected]” and nothing happens. There’s no email in my inbox to approve, I’ve looked in Spam, I’ve looked everywhere. It never gets sent.
Why is it pending? What can I do? Have I wasted the last two weeks? I’m finding this all so frustrating and upsetting. I am hoping someone here has the answer.
I keep trying, it says it’s pending, and then after updating my User profile it says at the top “Your email address has not been updated yet. Please check your inbox at?[email protected]
?for a confirmation email.”
But it never comes. And I don’t know why. I’m not stupid, I’ve been working on websites since 1994!
I’m using a PC, running Windows 10.
]]>sudo wp wc customer update 141 --meta_data="[{"key":"test_meta1","value":"test_meta_value"}]" --user=1
However, this does not work.
The result I get is
Success: Updated customer 141.
However,
sudo wp wc customer get 141 --fields=meta_data --user=1 | grep test_meta
returns blank.
curl -X PUT https://www.example.com/wp-json/wc/v3/customers/141 \ -u consumer_key:consumer_secret \ -H "Content-Type: application/json" \ -d '{"meta_data": [{"key": "test_meta1","value": "test_meta_value"}]}'
would work, but I’d prefer to use the wp wc CLI if possible, rather than the REST API.
I’ve also tried adding meta_data to products, with similar challenges – eg
sudo wp wc product create --name="test2" --sku="test2" --regular_price=10 --meta_data="[{"meta_data": [{"key": "test_meta1","value": "test_meta_value"}]}]" --user=1
What’s the right format for supplying meta_data on the wp wc CLI command line interface? I get it needs to be an array… but what format does that actually mean? Can anyone product a working example?
]]>paysera.php:
require_once ‘vendor/autoload.php’;
Fix:
require_once dirname( __FILE__ ) . ‘/vendor/autoload.php’;
]]>I have spent 2 days searching and obviously am not searching for the right info as I can not find a solution to allow wp-cli to be able to read the wp-config.php correctly or find another way to pass the database info to wp-cli to know where the database exists.
Can someone please help point me into the right direction?
My wp-config.php looks like this for the DB info.
==================================================================================
/** MySQL hostname */
define( ‘DB_HOST’, getenv_docker(‘WORDPRESS_DB_HOST’, ‘mysql’) );
/** The name of the database for WordPress */
define( ‘DB_NAME’, getenv_docker(‘WORDPRESS_DB_NAME’, ‘wordpress’) );
/** MySQL database username */
define( 'DB_USER', getenv_docker('WORDPRESS_DB_USER', 'example username') );
/** MySQL database password */
define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'example password') );
==================================================================================
Additional note... it appears since getenv_docker is not working it is trying to use default info... Of course that will not work. :(
# wp config list –allow-root
+———————+——————————————+———-+
| name | value | type |
+———————+——————————————+———-+
| table_prefix | bv_ | variable |
| configExtra | | variable |
| DB_NAME | wordpress | constant |
| MYSQL_CLIENT_FLAGS | 2048 | constant |
| DB_USER | example username | constant |
| DB_PASSWORD | example password | constant |
| DB_HOST | mysql | constant |
| DB_CHARSET | utf8 | constant |`
Based on the codex, I have started playing with
wp scaffold post-type movie --label=Movie --theme=twentytwentyone
I do have the php file created under wp-content/themes/post-types/movie.php
However there’s no movie post type appearing in the left menu.
Permalinks refreshed, menu position changed, following parameters verified :
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
Am I missing a step?
Thanks!
here’s the untouched code inside the php file :
<?php
/**
* Registers the <code>movie</code> post type.
*/
function movie_init() {
register_post_type( 'movie', array(
'labels' => array(
'name' => __( 'Movies', 'twentytwentyone' ),
'singular_name' => __( 'Movie', 'twentytwentyone' ),
'all_items' => __( 'All Movies', 'twentytwentyone' ),
'archives' => __( 'Movie Archives', 'twentytwentyone' ),
'attributes' => __( 'Movie Attributes', 'twentytwentyone' ),
'insert_into_item' => __( 'Insert into Movie', 'twentytwentyone' ),
'uploaded_to_this_item' => __( 'Uploaded to this Movie', 'twentytwentyone' ),
'featured_image' => _x( 'Featured Image', 'movie', 'twentytwentyone' ),
'set_featured_image' => _x( 'Set featured image', 'movie', 'twentytwentyone' ),
'remove_featured_image' => _x( 'Remove featured image', 'movie', 'twentytwentyone' ),
'use_featured_image' => _x( 'Use as featured image', 'movie', 'twentytwentyone' ),
'filter_items_list' => __( 'Filter Movies list', 'twentytwentyone' ),
'items_list_navigation' => __( 'Movies list navigation', 'twentytwentyone' ),
'items_list' => __( 'Movies list', 'twentytwentyone' ),
'new_item' => __( 'New Movie', 'twentytwentyone' ),
'add_new' => __( 'Add New', 'twentytwentyone' ),
'add_new_item' => __( 'Add New Movie', 'twentytwentyone' ),
'edit_item' => __( 'Edit Movie', 'twentytwentyone' ),
'view_item' => __( 'View Movie', 'twentytwentyone' ),
'view_items' => __( 'View Movies', 'twentytwentyone' ),
'search_items' => __( 'Search Movies', 'twentytwentyone' ),
'not_found' => __( 'No Movies found', 'twentytwentyone' ),
'not_found_in_trash' => __( 'No Movies found in trash', 'twentytwentyone' ),
'parent_item_colon' => __( 'Parent Movie:', 'twentytwentyone' ),
'menu_name' => __( 'Movies', 'twentytwentyone' ),
),
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
'supports' => array( 'title', 'editor' ),
'has_archive' => true,
'rewrite' => true,
'query_var' => true,
'menu_position' => null,
'menu_icon' => 'dashicons-admin-post',
'show_in_rest' => true,
'rest_base' => 'movie',
'rest_controller_class' => 'WP_REST_Posts_Controller',
) );
}
add_action( 'init', 'movie_init' );
/**
* Sets the post updated messages for the <code>movie</code> post type.
*
* @param array $messages Post updated messages.
* @return array Messages for the <code>movie</code> post type.
*/
function movie_updated_messages( $messages ) {
global $post;
$permalink = get_permalink( $post );
$messages['movie'] = array(
0 => '', // Unused. Messages start at index 1.
/* translators: %s: post permalink */
1 => sprintf( __( 'Movie updated. <a target="_blank" href="%s">View Movie</a>', 'twentytwentyone' ), esc_url( $permalink ) ),
2 => __( 'Custom field updated.', 'twentytwentyone' ),
3 => __( 'Custom field deleted.', 'twentytwentyone' ),
4 => __( 'Movie updated.', 'twentytwentyone' ),
/* translators: %s: date and time of the revision */
5 => isset( $_GET['revision'] ) ? sprintf( __( 'Movie restored to revision from %s', 'twentytwentyone' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
/* translators: %s: post permalink */
6 => sprintf( __( 'Movie published. <a href="%s">View Movie</a>', 'twentytwentyone' ), esc_url( $permalink ) ),
7 => __( 'Movie saved.', 'twentytwentyone' ),
/* translators: %s: post permalink */
8 => sprintf( __( 'Movie submitted. <a target="_blank" href="%s">Preview Movie</a>', 'twentytwentyone' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ),
/* translators: 1: Publish box date format, see https://secure.php.net/date 2: Post permalink */
9 => sprintf( __( 'Movie scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Movie</a>', 'twentytwentyone' ),
date_i18n( __( 'M j, Y @ G:i', 'twentytwentyone' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ),
/* translators: %s: post permalink */
10 => sprintf( __( 'Movie draft updated. <a target="_blank" href="%s">Preview Movie</a>', 'twentytwentyone' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ),
);
return $messages;
}
add_filter( 'post_updated_messages', 'movie_updated_messages' );
]]>