Hot answers tagged

5

You do have a large amount of posts which will crash your server (due to maximum execution time being exceeded) with such an expensive operation. We will need to run this in a much more cleverer way. First of all, we would want to get all posts, except revision and nav_menu_item. Revision post_names are build in a different way, and trying to handle them ...


4

WordPress does not support MySQL 4 : To run WordPress your host just needs a couple of things: MySQL version 5.0 or greater (recommended: MySQL 5.5 or greater) https://wordpress.org/about/requirements/ While the utf8mb4 encoding is recent change and you might work around it, overall you still need compatible MySQL version.


4

The error isn't actually caused by your PHP version (PHP 4 constructors won't be removed until PHP 7) - it's a warning produced by WordPress in preparation for this. Each repetition of the error represents a plugin using the outdated code. Until your plugins' authors update them, you can run the following shell command on a Linux system to find the old ...


3

That's an issue with the latest version of Chrome. I am on version 45.0.2454.85 and had the same issue. See this article for the full details and solution. http://wptavern.com/a-bug-in-chrome-45-causes-wordpress-admin-menu-to-break


3

Yes, a plugin that does not properly clean up after itself can continue to affect your site even after deletion. It can leave stuff behind in the database, or make alterations to your .htaccess file, which is probably the case in your scenario. You might need to restore your .htaccess file - look here for help with that.


3

That is called an Anonymous Function and is only supported in later versions of PHP, specifically 5.3.0 and later. If I were a betting man I would say your server has an earlier version of PHP. Try this instead: /*Add meta boxes to contact page*/ function contact_metaboxes( \WP_Post $post ) { global $post; if( ! empty( $post ) ) { ...


3

For WordPress Website optimization you should take a look at: https://codex.wordpress.org/WordPress_Optimization I took a look at your pagespeed report and the main thing there are the images you are using. There are many plugins that can optimize them for you. I like this one in particular: https://wordpress.org/plugins/imsanity/ As per the server cache, ...


3

You should reread the error messages. Custom taxonomies, custom post types and shortcodes should not be registered in a theme, that should be standard practice. Custom taxonomies, custom post types and shortcodes shoule be registered in a plugin.


2

As you are using PHP 5.5+ versions, the old PHP 4 things will throw errors … of course. The error comes from – as you can read – the WordPress importer plugin, which is some kind of badly treated step child of WordPress. plugins/wordpress-importer/wordpress-importer.php:38 One solution is to use our fork with fixes from wecodemore/GitHub, where you can ...


2

The problem, as pointed out in the php error, is on line 7 of the "chat.php" file: add_action( 'init', ic_show_chat_bar()); This line has two problems: The correct syntax for a valid callback function should be without the parenthesis and wrapped in single quotes. Since the function is declared inside a php class, it won't be accesible to add_action ...


2

Problem found to be caused by the plugin Enhanced Ecommerce Google Analytics Plugin for WooCommerce version 1.0.16. I gather the fact that this version of the plugin has not been tested with Wordpress 4.3.1 has something to do with the problem.


2

It's just simple, same reply from Error in WP_update_post but in your case there is small change. Just use wp-load.php as include. No need to include post.php. Once the wp-load.php file is included, the entire wealth of WordPress functions is provided to you. For pull the recent post, you need to use wp_get_recent_posts() wordpress function which is from ...


2

Xan is a georgian letter as I can find in Google, but it's not a valid Unicode Script for RegEx, you can find a list of the Unicode Scripts here: http://www.regular-expressions.info/unicode.html Maybe try using another one than Xan, maybe Georgian: preg_match( '/[\p{Georgian}]/u', $content, $results ); Let me know how that goes.


2

This error: Fatal error: Call to a member function insert() on a non-object Means that $wpdb isn't instantiated so you are running your code too early or out of WordPress context-- for example, in an exterior PHP file accessed directly, which is what I suspect (Poorly conceived AJAX request perhaps?). As mentioned, the code has more formats that data ...


2

WordPress is giving you a notice that this construct is deprecated, because it is preparing for PHP7. You should check your custom code and any plug-ins for the use of the WP_Widget construct. There are (still) a lot of plug-ins that need to update their code. Here is a list of plug-ins that use the deprecated WP_Widget construct: ...


2

Login as WordPress administrator Navigate to add a new user Check box to bypass email confirmation Add the user with a different email address Edit the user's email address to the desired result For the similar username error, see How can I un-reserve a pending username registration? The timeout period is 2 days following a conflict, and trac tickets to ...


2

Please look up before posting your questions ! There is a detailed answer available. http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php


1

Fatal error: Cannot redeclare append() is very simple to fix: Your plugin seems to have a function called append(), right? On the wordpress install with this error there is another plugin which has a function append() too. You can fix this using PHP Namespaces or just give your function a more unique name like pluginname_append().


1

It seems that it's not WP_Widget that's being updated, but the way it is referenced. I believe what we want is to go from this: class mZ_Mindbody_day_schedule extends WP_Widget { function mZ_Mindbody_day_schedule() { $widget_ops = array( 'classname' => 'mZ_Mindbody_day_schedule_class', ...


1

15 in two days is nothing. I've seen thousands per day. If your passwords are good, don't worry about it but please make sure the passwords are good by nerd standards and not by common standards. If it really worries you, there are plugins out there like Limit Login Attempts that can help and I believe that the site's highest ranked user, toscho, was ...


1

If you can log into your host with SSH or FTP, it's an easy fix. Like the comments said before, check your permissions for the Wordpress directory. For example, if you check the hosting directory with ls -al (typically /var/www, as on DigitalOcean), they should look something like this: drwxrwxr-x 6 www-data www-data 4096 Nov 14 17:00 wordpress That ...


1

This wouldn't be caused by a change in the database. What the error refers to is this: SELECT SQL_CALC_FOUND_ROWS wp_posts.id FROM wp_posts WHERE 1 = 1 AND 0 GROUP BY wp_posts.id ORDER BY wp_postmeta.meta_value + 0 DESC, wp_posts.post_date DESC LIMIT 0, 10 Your code only includes data from the wp_posts table (second line above) but ...


1

in my case, it was simply the SITE URL left blank in Settings -> General Filled with mu site URL, everything started working again. i found out enabling WP_DEBUG in wp-config.php, and i got this error: "Notice: Undefined index: host"


1

If you want to keep WP_DEBUG on and do you want to hide this specific type of error, put in your theme functions.php this line: add_filter('deprecated_constructor_trigger_error', '__return_false'); This will prevent this kind of error to be displayed. I hope it helps :)


1

Textdomain Error The error message mean, that you haven't a textdomain. There is required for translation of this string. In the first error message is the problem the missing textdomain on the function _n_noop(). Right usage as example below. _n_noop( 'Security Release', 'Security Releases', 'your_textdomain' ); Text Domain Information about the ...


1

Create a new file names wp-config.php and paste all the code than enter your db credentials it will solve your wp-config issue. <?php /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting ...


1

You need to create wp-config.php file. This new file is copy of wp-config-sample.php find it in root directory. After creating this copy name it wp-config.php and set up database setting into it. Also give access permission to it. Let me know if above wording is not used to for you.


1

I am not sure where you got that export code but I don't see the PRIMARY KEY defined as it should be. Take a look at the code from Core that creates the table: 87 CREATE TABLE $wpdb->commentmeta ( 88 meta_id bigint(20) unsigned NOT NULL auto_increment, 89 comment_id bigint(20) unsigned NOT NULL default '0', 90 meta_key varchar(255) default ...


1

EDIT: If you use $post in a function, you have to define it of course: function xyz(){ global $post; //Your code } Initial answer, might help others: It appears to me, you do not use it inside an action or if so, you use it to early. It should work inside the 'init' action. So you could do something like <?php add_action( 'init', ...


1

The function is_wp_error checks if the given var is an instance of WP_Error class (soruce code as WP 4.2.2): function is_wp_error( $thing ) { return ( $thing instanceof WP_Error ); } As you can see, if the given variable is a instance of WP_Error class, the function returns true, even if the object is empty. Your $error variable is a WP_Error ...



Only top voted, non community-wiki answers of a minimum length are eligible