in_array not working on dev server but works on localhost

I’ve written a loop which works on my local machine but not on my dev server. My dev server is running PHP 7.4.13 and my MAMPRO is running 7.4.12.

The dev server code displays nothing and with no errors and the local version displays as expected.

7.4.12 is not installed my server so I cannot test to see if it is a version issue.

I tried printing the variables at different stages, but nothing happened inside the if(in_array part.

Is the PHP version difference likely to be the cause or is it likely to be something else?

                // Query products where product title matches a tag in the current article                  $  current_article_tags = wp_get_object_terms(get_the_ID(), 'knowledge_hub_tag', array('fields' => 'names'));                  //echo '<pre>'; print_r($  current_article_tags); echo '</pre>';                  $  related_products = new WP_Query(array(                   'posts_per_page' => -1,                   'post_type'=> 'product',                   /*'post_title' => array(                       array(                           //'taxonomy' => $  current_article_tags,                           'post_title' => 'varilite icon mid',                           'operator'=> 'IN' //Or 'AND' or 'NOT IN'                       ),                   )*/                 ));                  //echo '<pre>'; print_r($  related_products); echo '</pre>';                  $  products = $  related_products->posts;                  //echo '<pre>'; print_r($  products); echo '</pre>';                  //if ($  related_products->have_posts()){                      foreach($  products as $  product) {                          if(in_array($  product->post_title, $  current_article_tags, true)) {                                                             echo '<p><a href="'.get_permalink( $  product ).'">'.get_the_title($  product).'</a></p>';                         }                     }                  //}                  //wp_reset_postdata(); 

Linked server only works if I am on the machine itself. I can’t use it from my local computer. what is missing?

I have a few queries that I use to monitor log shipping. Sometimes I want to run those queries on a different server. I usually do that through a linked server.

I have a server called SQLDEV4-TS that has a linked server to MY_SERVER\DEVELOPMENT

ON SQLDEV4-TS I have setup Kerberos as per the picture below:

enter image description here

I have this query below that I use to test the connectivity to the linked server.

DECLARE @server_name sysname = @@servername SELECT @server_name=N'MY_SERVER\DEVELOPMENT'   DECLARE @sql NVARCHAR(MAX) = N'SELECT * FROM OPENQUERY([' + @server_name +'],        ''SELECT ''''Radhe'''' AS Radhe'');'  BEGIN TRY     EXEC sp_testlinkedserver @server_name      EXEC sp_executesql @sql=@sql  END TRY BEGIN CATCH     SELECT [error_number]=ERROR_NUMBER(), [error_message]=ERROR_MESSAGE(); END CATCH;  PRINT 'We got past the Catch block!'; 

When I am on the server itself – SQLDEV4-TS – and I run the above script I get the following result:

enter image description here

All good – it works as expected – no problem.

However, when I connect to SQLDEV4-TS from my local machine, and run the script (on my machine) I get the following result:

Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.

enter image description here

What is missing in this linked server setting, that I have to be on the machine itself for it to work?

Woocommerce get_term_by() in transition_post_status hook doesn’t works

Im having this code

$  concours_termine_cat = get_term_by('slug' , 'concours-termine' , 'product_cat'); 

get_term_by is returning false, after debugging the get_term_by function

taxonomy_exists( 'product_cat');  

is returning false.

So I checked in taxonomy_exists function and looks like into $ wp_taxonomies product_cat doesn’t exist at this time of execution.

I call this hook like this add_action('transition_post_status' , 'vince_function_post_update' , 10 , 3);

get_the_excerpt doesn’t work with default items but works with my customs post types

the excerpt function not work in my custom post template using WordPress default posts in the query loop, but they work fine with custom post type.

I enabled the display of excerpt by checking the "excerpt" option in the post options fields.

I also added "add_post_type_support(‘page’ ‘excerpt’)" in my function.php file but it doesn’t working.

I suspect a problem coming from the database because the excerpts are displayed when I test the website locally with Xampp.

Here is a snippet of the code used in my page template:

<div class="container">                      <div class="row">                         <div class="col-lg-9 col-mg-9 mp-blog" style="padding-right: 24px;">                                                 <div class="row">                                  <?php                                 $  paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                                  $  args = array(                                   'post_type'=>'post', // Your post type name                                   'posts_per_page' => 6,                                   'cat' => 26,                                   'paged' => $  paged,                                 );                                                                  $  loop = new WP_Query( $  args );                         if ( $  loop->have_posts() ) {                             while ( $  loop->have_posts() ) : $  loop->the_post();?>                        <?php the_excerpt();?>                        <?php endwhile;                              $  total_pages = $  loop->max_num_pages;      if ($  total_pages > 1){          $  current_page = max(1, get_query_var('paged'));     ?>     <div class="custom_pagination">        <?php         echo paginate_links(array(             'base' => get_pagenum_link(1) . '%_%',             'format' => '/page/%#%',             'current' => $  current_page,             'total' => $  total_pages,             'prev_text'    => __('« précédent'),             'next_text'    => __('suivant »'),         ));?>     </div>     <?php }     } wp_reset_postdata();?>                     </div>                 </div><!-------------- end of col-8 ------------------>               <div class="col-lg-3 col-mg-3" style="padding: 0;">                   <div id="tching" class="blog_right_sidebar" style="padding: 0 15px;">                       <?php get_sidebar(); ?>                   </div>               </div>             </div>          </div> 

How Microsoft Junk Mail filter really works based in body content links?

I’m not here to discuss about DKIM, DMARC, SPF, or other of the hundreds of variables in the difficult path to get your email into the Inbox instead of Junk folder.

I’m here just about the links in the body content of the email, and I’ll tell you why.

I have been sending dozens of emails from a Google Apps mail account, to a hotmail.com account.

It was just TEXT, this text:

Hi there !!! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis imperdiet eros sit amet placerat. Aenean blandit efficitur eros non mattis. Integer vehicula nunc eget est vulputate, sit amet consequat ipsum feugiat. Aliquam massa odio, dignissim vel luctus in, aliquam sit amet est. Aliquam erat volutpat.   Phasellus egestas, dolor in tempor ullamcorper, tortor lectus auctor neque, vel suscipit diam tellus tempus tortor. Nam vulputate euismod ligula, ac tempor arcu tempus at. Donec ultricies velit sed justo mollis accumsan at nec nisi. Vestibulum a diam ac magna varius consectetur. Donec in justo vitae ex lacinia imperdiet. Nullam gravida urna leo. Etiam congue, dui a commodo feugiat, risus tellus tempor neque, eget vestibulum erat ex non augue.  If you want you can visit: https://xxxxxxxxx.xxxx  Donec pulvinar rutrum commodo. Cras porta facilisis bibendum. Pellentesque pretium est sem, ut varius diam suscipit quis. Aenean et eros auctor, rhoncus mi in, dignissim odio. Suspendisse suscipit enim lorem, quis interdum massa consectetur in. Integer suscipit eros sodales hendrerit tempor. Etiam finibus semper tellus, ac suscipit orci mollis eu. Pellentesque vehicula auctor ultrices. In hendrerit dolor quis lorem laoreet, vel convallis magna laoreet. Sed pulvinar non magna maximus dapibus.  Nullam semper lacus eget hendrerit dapibus. Morbi eget urna eleifend, consectetur elit ac, fermentum orci. Mauris et urna est. Mauris ac lacinia lectus. Vestibulum scelerisque tempor nibh ac eleifend. Nulla faucibus tellus blandit quam suscipit ultricies. Suspendisse finibus risus id lectus lobortis mattis.  Regards 

The only change was the ONLY link in all email content. Everything was exact the same. The content, the subject, the sender … I just changed that link.

What I saw is with some links, the email goes to Inbox folder With other links, it goes to the Junk folder.

Just that ! Just because of the domain name of the only link in the body content.

Why is that?

I try to figure out things like:

  • domain age
  • domain – ip and reverse
  • domain ip in ip’s blacklist
  • domain in domain’s blacklist
  • domain has https activated
  • and some other variables

but I can’t get any "rule" that satisfies why sometimes "that link" is "good" or not to Microsoft Junk Email Filter.

Does anyone know any clue in order to check the list of "good" domains and "bad" domains I have so we can all learn about this? 😉

FindMaximum works on desktop but not on laptop

I have a simple code to find maximum as follows.

myfunc = {-1 + 2/(1 + d), 1/2 (-1 + 1/d), 1 - d, 1 + 1/(-2 + d),     1 - d, 1 - d, -1 + 1/d, -1 + 1/d, 1/(1 + d), 1/(2 d), 1/d, 1/d, d/(    1 - d)}; FindMaximum[{##, 0 <= d <= 1}, d] & /@ myfunc 

It works well on my desktop and the result is:

{{1., {d -> 0.}}, {\[Infinity], {d -> 0.}}, {1., {d ->      0.}}, {0.5, {d -> 0.}}, {1., {d -> 0.}}, {1., {d ->      0.}}, {\[Infinity], {d -> 0.}}, {\[Infinity], {d ->      0.}}, {1., {d -> 0.}}, {\[Infinity], {d ->      0.}}, {\[Infinity], {d -> 0.}}, {\[Infinity], {d ->      0.}}, {\[Infinity], {d -> 1.}}} 

However, I got error with $ Failed when I ran it on my laptop.

{{1., {d -> 3.54538*10^-8}}, {-$  Failed, {d -> 0.}}, {1., {d ->      0.}}, {0.5, {d -> 0.}}, {1., {d -> 0.}}, {1., {d ->      0.}}, {-$  Failed, {d -> 0.}}, {-$  Failed, {d -> 0.}}, {1., {d ->      0.}}, {\[Infinity], {d -> Indeterminate}}, {\[Infinity], {d ->      0.}}, {\[Infinity], {d -> 0.}}, {\[Infinity], {d ->      Indeterminate}}} 

Why does this happen? How can I solve this?

Does Ranger Monster Hunter’s Slayer’s Counter works on saves to maintain concentration?

From the Sage Advice Compendium:

Does a Monster Slayer ranger’s Supernatural Defense feature apply if a creature damages the ranger, thus causing the ranger to make a Constitution saving throw to maintain concentration on a spell? Yes.

Since the Supernatural defense works for concentration, does the Slayer Counters works as well?

How exactly Power Attack and critical hit works together?

I tried to follow the rules and check FAQs but now I need a help:

I got a 13° liv THF (two-hand fighter) and 6° liv Aegis (BAB=19) and 5° Mithic tier, with Power Attack and Mithic Power Attack (but not obviously Greater Power Attack) and 34 Strenght+Brawn (+12 mod), here are damage stats as I supposed:

    12x1.5= 18(THW)      +3(Weapon Training)      +6(Weapon Specialization+2, Greater+2, Mithic+2)      +4(Magic Weapon mod)      +3(Improved Damage from Astral skin customization)      +1(Psionic Damage from Astral skin customization)      +1(Psionic Weapon feat) and      +24(Power Attack,Mithic) = 60 for first attack and 66 for iterative (due to Backswing) 

Now the question is: Whats happens with a critical hit on each point? – I’ve found many question and I read not enough answers about it so I fall in chaos each critical hit (no more a great pleasure but a trouble)-.

and then another question regarding Power Attack and Critical hit is:

Whats happens at 15° liv (for THF archetype) and Power Attack change to Power Attack, Greater ?

Thanks