Lukasz
Forum Replies Created
-
Thank you for the fix!
Thank you for the fix!
Forum: Plugins
In reply to: [Contact Form 7] get_locale() and translation functions __() not working@takayukister found the issue!, looks like CF7 stores the locale in post_meta and it had the incorrect locale, maybe since I updated from a very old version of Cf7 or it was just never set correctly.
Here’s what I found in the DB:INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES (89765,'_locale','en_CA');
//Fix CF7 locale, set manually to desired locale, remove this line once set.
update_post_meta( 89765, '_locale', 'fr_CA' );Forum: Plugins
In reply to: [WordPress Popular Posts] PHP Warning errors in logFound the issue! – when I disable this filter, the error goes away, it seems null is being passed from this function when no views found
function my_custom_no_posts_found( $no_data_html ) {
//$output = '<style type="text/css">.popular-posts { display:none; }</style>';
$output = '';
return $output;
}
add_filter( 'wpp_no_data', 'my_custom_no_posts_found', 10, 1 );I think I will just set .wpp-no-data as display none, to get the desired output.
Phew, thank you for your time on this, very much appreciated!
- This reply was modified 1 month, 4 weeks ago by Lukasz.
Great, thank you, and just this, simple to fix, I currently have it modified so it stops throwing errors:
PHP Deprecated: ?Using ${var} in strings is deprecated, use {$var} instead in …\wp-content\plugins\contact-form-7-conditional-fields-pro\pro\summary.php on line 101Forum: Plugins
In reply to: [WordPress Popular Posts] PHP Warning errors in log@hcabrera thanks for getting back. I copied in your code and just changed to one of the my categories which does not have any popular posts and received the exact same errors as before. As soon as I add a view to one of the posts in the category, the error disappears, so it’s only posts with empty views that throw the error, this wont really be issue in prod.
But, I tried your code on my functions.php, and it worked, no error, just blank if their is no views and link if their is views. So could it be a timing issue on page.php, maybe the function should be called within a hook or something to fire at the right time? This may not be sufficient:global $post;
if ( is_page( $post->ID ) && ! is_page( $contactUsPage ) ) {Edit: The is_page doesn’t make a difference, removed or not. Something to do with outputting the results on page.php.
- This reply was modified 2 months ago by Lukasz.
Forum: Plugins
In reply to: [WordPress Popular Posts] PHP Warning errors in logThis appears to happen when there is no popular posts in certain categories, for example I have pages with associated categories, the category for the page is returned and then wpp checks for any posts in that category and passes null to the output which is then attempted to be processed. I’ll try to see if I an add some error handling for this situation.
This is from my page.php:global $post;
? ? ? ? ? ? ? ? ? ? if ( is_page( $post->ID ) && ! is_page( $contactUsPage ) ) {
? ? ? ? ? ? ? ? ? ? ? ? $helpfulArticles = esc_html__( 'You might also find these helpful.', 'domain' );
? ? ? ? ? ? ? ? ? ? ? ? $key_name = get_post_custom_values( $key = 'cat' );
? ? ? ? ? ? ? ? ? ? ? ? $cat_ID ? = get_cat_ID( $key_name[0] );
? ? ? ? ? ? ? ? ? ? ? ? if ( function_exists( 'pll_register_string' ) ) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? $currentID = pll_get_post( 300 );
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? $closerForAside = '<li><a href="' . esc_url( get_permalink( $currentID ) ) .
? ? ? ? ? ? ? ? ? ? ? ? ? ? '">'
? ? ? ? ? ? ? ? ? ? ? ? ? ? . esc_html__( 'See all Articles', 'domain' ) . '<i class="fa fa-angle-right" aria-hidden="true"></i></a></li></ul></section></div>';
? ? ? ? ? ? ? ? ? ? ? ? $args = array(
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'post_type' ? => 'post',
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'limit' ? ? ? => 3,
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'cat' ? ? ? ? => pll_get_term( $cat_ID, 'en' ),
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'stats_views' => 0,
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'range' ? ? ? => 'all',
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'freshness' ? => 1,
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'wpp_start' ? => '<div id="popularPosts" class="sidebar popularPosts" aria-labelledby="helpfulArticles">
? ? ? ? ? ? ? ? <section class="sidebarHelpTopics"><h2 id="helpfulArticles">' . $helpfulArticles . '</h2><ul>',
? ? ? ? ? ? ? ? ? ? ? ? ? ? 'wpp_end' ? ? => $closerForAside,
? ? ? ? ? ? ? ? ? ? ? ? );
? ? ? ? ? ? ? ? ? ? ? ? wpp_get_mostpopular( $args );
? ? ? ? ? ? ? ? ? ? }Forum: Plugins
In reply to: [WordPress Popular Posts] PHP Warning errors in logHey @hcabrera,
Interesting, I will have a look at the thread in greater details and share reproduction steps.
Forum: Fixing WordPress
In reply to: Website is disjointedYour site is running on insecure http protocol which is why it’s breaking. Make sure your server is setup with HTTPS and not HTTP and also setup redirect all traffic from http to https and set the strict transport security header either via server or in your code.
Make sure to update your URL in general settings to HTTPS, WordPress should handle the search and replace of all your urls.
You are also running on outdated PHP version which is no longer receiving security updates, you need to update to PHP 8+.
- This reply was modified 7 months, 3 weeks ago by Lukasz.
Forum: Fixing WordPress
In reply to: Site Health (WP6.5) not recognizing MySQL 8.1Paste the info from the info tab under database to see what you have installed.
All posts have to have a category. You can choose the default WordPress sets under settings -> default post category
Thank you @hcabrera!
I narrowed down to this commit https://github.com/cabrerahector/wordpress-popular-posts/commit/3af6f8547e616e1caddccb576c230f1b2e7ae174
I did quick test, I copied that file(src/Query.php) from the 6.1.1 to 6.1.2 and the French was displaying. Just have to figure out what line is specifically causing it.Forum: Plugins
In reply to: [WordPress Popular Posts] Vulnerability ErrorIt means you should update to the latest version 6.3.3 which fixes that vulnerability.
Forum: Developing with WordPress
In reply to: Accessible PDF generation (tagging support)YES, I did make a mistake, I didn’t even realize, I interchange WordPress with PHP haha..anyways I am looking into a bunch of JavaScript and PHP PDF generation libraries and will see how it goes!
Thank you for getting back! although my host does use wp-cli, they don’t allow me to use it or any command line type of tools unfortunately. I may try playing around with the APIs to trigger a migration or some other method.