Call to undefined function mysql_connect() After upgrading PHP 7.1 to 7.3

I mean your php.ini is changed, check for the entry extension=php_mysqll.dll. (If you has no knowledge where is your used php.ini – see https://stackoverflow.com/questions/8684609/dude-wheres-my-php-ini) Is this entry active, has no ; before the string. After change of the php.ini you need a restart of mysql, like sudo /etc/init.d/mysql restart. Also a note, check that mysql … Read more

Why is one phpunit test throwing an error on one class when all other classes are similar without error?

the async property is marked as protected, so that usually signifies that it is related more to your implementation’s details rather than functionality. Ideally you would write your tests to test the public methods you have exposed. Testing that the class property you set in the constructor of one class is an instanceof what was … Read more

Loading php file with AJAX in WordPress frontend

Try using get_template_part() function. use ob_end_clean() to Clean the output buffer and turn off output buffering. I have use html() to append data jQuery(‘#ajax’).html(response.content);. I have tested and working fine for me. jquery : jQuery(“#ajaxbtn”).click(function () { jQuery.ajax({ type : ‘post’, dataType : ‘json’, url : myajax.ajax_url, data : {action: ‘tablo’}, success: function(response) { jQuery(‘#ajax’).html(response.content); … Read more

Shortcode with PHP issue “Undefined index”

It’s because if the user enters large=”true”, then $atts[‘small’] isn’t defined. The normal solution is to use shortcode_atts() to set default values for the parameters, but you’re not putting the result of shortcode_atts() into $atts, you’re just just extracting it. This means that $small will be defined, but $atts[‘small’] won’t be. The proper way to … Read more

How to Return in WordPress Function php file?

Your function should look something like this function my_custom_function( $html, $content ) { $html .= get_post_field(‘post_content’, $post_id); $html = “<div class=”post”>” . $html . “</div>”; return $html; }

Can WP plugins access files outside the installation folder?

Can they theoretically develop a WP plugin to access the files (or even WP config, including DB credentials) of another WP installation? Yes. If your folders are owned by the same user, run as the same user in Apache/Nginx or have read/write access to each other, then it’s possible. Your installations are sandboxed at the … Read more