Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Demonslay335

    (@demonslay335)

    Ah, yes, that seems to be the issue.

    No index defined!

    I’ve compared with another WordPress site’s database and confirmed name should be the PRIMARY KEY. Not sure how the index was not added during install of the plugin, all other WordFence tables have their indexes.

    Thank you for the prompt response, this should fix the issue (I have to first consolidate the duplicate keys before MySQL will allow me to add the index). I’ll mark this as resolved and re-open it if I run into further issues.

    Thanks!

    Thread Starter Demonslay335

    (@demonslay335)

    @wfasa

    Yep, no issues in the Diagnostics, everything has happy green checkmarks.

    Wordfence Config - Ability to save Wordfence settings to the database.
    Checking basic config reading/writing - [✓] Basic config writing
    Checking serialized config reading/writing - [✓] Serialized config writing
    
    MySQL Database version and privileges.
    Database Version - 5.5.61-cll
    Checking if MySQL user has DELETE privilege - OK
    Checking if MySQL user has INSERT privilege - OK
    Checking if MySQL user has UPDATE privilege - OK
    Checking if MySQL user has SELECT privilege - OK
    Checking if MySQL user has CREATE TABLE privilege - OK
    Checking if MySQL user has ALTER TABLE privilege - OK
    Checking if MySQL user has DROP privilege - OK
    Checking if MySQL user has TRUNCATE privilege - OK

    Here’s the diagnostics on the wp_wfConfig table.

    Name	Comment	Engine	Rows	Avg_row_length	Data_length	Index_length	Auto_increment	Create_time	Row_format	Collation	Version	Max_data_length	Data_free	Update_time	Check_time	Checksum	Create_options
    wp_wfConfig		MyISAM	15999	81	3205484	1024		2018-09-26 21:53:52	Dynamic	utf8_general_ci	10	281474976710655	1894052	2018-10-08 14:35:38	

    Also got a broken site here, WP 4.6.1. I’m not seeing the folders do or widget that is referred to in the includes.

    Replying mostly to subscribe to updates as well.

    One of the sites I manage is under this exact same attack for the last 48 hours. Just annoying to have Wordfence alerts about it every 4 minutes… good to know its doing it’s job! Seems to have some random IPs from other countries too, but Russia has been 98% of it so far. Already noticing this plugin take effect. Simple and does what it advertises!

    Thread Starter Demonslay335

    (@demonslay335)

    ambruck,

    Please be sure that you have edited the correct file. It looks like, from the line number, it may have not taken your change properly. The line number for the error stayed the same (537) even with the addition of code, which should have pushed the afflicted line down.

    Here is what the whole function should look like.

    /**
     * Load Google Maps API
     *
     * @description: Determine if Google Maps API script has already been loaded
     * @since      : 1.0.3
     * @return bool $multiple_google_maps_api
     */
    public function check_for_multiple_google_maps_api_calls() {
    
    	global $wp_scripts;
    
    	$multiple_google_maps_api = false;
    
    	/**
    	*	Prevent crashes for guests
    	*	@link	https://wordpress.org/support/topic/invalid-argument-25
    	*/
    	if(is_null($wp_scripts) || is_null($wp_scripts->registered)){
    
    		return $multiple_google_maps_api;
    
    	}
    
    	//loop through registered scripts
    	foreach ( $wp_scripts->registered as $registered_script ) {
    
    		//find any that have the google script as the source, ensure it's not enqueud by this plugin
    		if ( strpos( $registered_script->src, 'maps.googleapis.com/maps/api/js' ) !== false && strpos( $registered_script->handle, 'google-maps-builder' ) === false ) {
    
    			$multiple_google_maps_api = true;
    			//ensure we can detect scripts on the frontend from backend; we'll use an option to do this
    			if ( ! is_admin() ) {
    				update_option( 'gmb_google_maps_conflict', true );
    			}
    
    		}
    
    	}
    
    	//Ensure that if user resolved conflict on frontend we remove the option flag
    	if ( $multiple_google_maps_api === false && ! is_admin() ) {
    		update_option( 'gmb_google_maps_conflict', false );
    	}
    
    	//returns boolean
    	return $multiple_google_maps_api;
    }

    If you continue to have issues, I can send you the file.

    Thread Starter Demonslay335

    (@demonslay335)

    grazianochiappa,

    The error actually tells you exactly which file the error occurs in. You can either use FTP and edit the file remotely, or use the WordPress admin panel to edit the file.

    The file in question is class-wordpress-google-maps.php, the full path is in the warning itself.

    Thread Starter Demonslay335

    (@demonslay335)

    nimeck,

    My proposed patch would look as follows:

    if(is_null($wp_scripts) || is_null($wp_scripts->registered)){
    
    	return $multiple_google_maps_api;
    
    }
    
    //loop through registered scripts
    foreach ( $wp_scripts->registered as $registered_script ) {
    	// Loop code...
    }

    Note that the code I suggested goes before the loop, to prevent the loop from crashing if the variable is NULL unexpectedly.

    Thread Starter Demonslay335

    (@demonslay335)

    Awesome, thanks for the quick reply. I look forward for that release. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)