Can I check plugins and themes for PHP 5.6 ahead of global PHP server Update

My server is updating to PHP 5.6 next week. I manage about 30 WordPress websites. I looked for a plugin that would check if any of the code throughout the other plugins and theme would break with the update. I tried using the log deprecated notices plugin but it didn’t seem very conclusive as to … Read more

_deprecated_argument for constants

i’m working on updating a theme and previously it had used a lot of php CONSTANTS to set up some options as true or false. we’re going to be updating these “decisions” to use add_theme_support() instead. is it appropriate to use the _deprecated_argument() function to tell child themers that these constants are deprecated? if not, … Read more

Use ‘add_theme_support’ instead of ‘add_custom_image_header’ In WordPress 3.4

I am debugging my theme using Debug Bar plugin, which is showing me this error (among a few others): Notice: add_custom_image_header is deprecated since version 3.4! Use add_theme_support( ‘custom-header’, $args ) instead. Okay, clearly, it says I need to use this instead of this. The question is, add_custom_image_header has three parameters, namely: $header_callback $admin_header_callback $admin_image_div_callback … Read more

Warning/Notice about functions.php

I have trouble about the notice shows on the top of the home page as: Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in …/wordpress/wp-includes/functions.php on line 2925 The code of this line is something about $wpsmiliestrans: ‘;)’ => ‘icon_wink.gif’, If I delete this code, it … Read more

How to replace bloginfo(template_url)

Basically I’ve used bloginfo(template_url) in a WordPress theme, but when I run theme-checker, it recommends to replace bloginfo(template_url) with get_template_directory_uri(), however when I use get_template_directory_uri() it doesn’t work. It works fine if I use it to replace get_bloginfo(template_url) but that’s not what I want now. Is bloginfo(template_url) being deprecated? If it is, what is it’s … Read more

How can I see a list of pages and post where my custom Gutenberg block is used?

Background: Creating Custom Gutenberg Blocks and the Challenges with Breaking Changes I am new to creating custom Gutenberg blocks (each block is a separate plugin) and have recently ran into the issue of breaking changes when I update the blocks’ code. I learned how block depreciation can help solve the issue of breaking code changes, … Read more

What is the best way to handle deprecated functions?

WordPress 3.3 has deprecated the add_contextual_help() functions and it’s filters, so in order to continue supporting 3.0 – 3.2.1 and also comply with 3.3, I have done the following: global $wp_version; if ($wp_version >= ‘3.3’) { // New method add_action(“load-$admin_page”, ‘CrayonSettingsWP::help_screen’); } else { // Depreciated method add_filter(‘contextual_help’, ‘CrayonSettingsWP::cont_help’, 10, 3); } Is there a … Read more

Deprecating functions in a plugin class

I’m updating one of my plugins and I’m a little stuck with deprecating functions. Originally, my plugin had a global variable and the plugin’s main class was instantiated and stored in the global variable. This way users could use the global to access functions in the plugin class. $GLOBALS[‘my_custom_plugin’] = new my_custom_plugin(); Then, for example, … Read more