Forum Replies Created

Viewing 15 replies - 16 through 30 (of 45 total)
  • Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Testing this, it only updates one of the load-balanced servers leaving us with mixed versions – yikes! Any fix possible, e.g. wp-cli trigger an update?

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Thanks Alimir

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Looks like it’s updated to 3.6.7 now 🙂

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Great thanks – that explains why I couldn’t find it in the code 🙂 I’ll do compatibility checks on future versions and build some functional tests. I’ll also get the ball rolling on updating our PHP — I do appreciate the early warning.

    Actually nvm I figure it out looking at the code — the -IN condition checks for an exact match in that particular CAS attribute’s array of values, so
    (CAS{eduPersonAffiliation} -IN “employee”)
    will not match the <cas:eduPersonAffiliation>former_employee</cas:eduPersonAffiliation>value

    Hi – can you please clarify the docs
    https://wpcassify.wordpress.com/wp-cassify-plugin-documentation/
    regarding multi-value attributes?

    I’ve got these CAS attributes
    <cas:eduPersonAffiliation>student</cas:eduPersonAffiliation>
    <cas:eduPersonAffiliation>employee</cas:eduPersonAffiliation>
    <cas:eduPersonAffiliation>former_employee</cas:eduPersonAffiliation>

    and want to allow if they have the employee affiliation. -CONTAINS inappropriately allows the user if they only have former_employee. I tried various combinations like:
    (CAS{eduPersonAffiliation} -IN “employee”) -AND (CAS{eduPersonAffiliation} -NOTIN “_employee”)
    (CAS{eduPersonAffiliation} -CONTAINS “employee”) -AND (CAS{eduPersonAffiliation} -NOT -CONTAINS “_employee”)
    (CAS{eduPersonAffiliation} -CONTAINS “employee”) -AND -NOT (CAS{eduPersonAffiliation} -CONTAINS “_employee”)
    (CAS{eduPersonAffiliation} -CONTAINS “employee”) -NOT (CAS{eduPersonAffiliation} -CONTAINS “_employee”)

    I’m also not clear how to test this in test.php. Here’s what I’ve got, which incorrectly yields bool(false):

    
    $mock_cas_object = array(
    	'first_name' => 'someuser',
    	'email' => '[email protected]',
    	'eduPersonAffiliation' => array('employee,student,former_employee')
    );
    ...
    $condition = '(CAS{eduPersonAffiliation} -IN "employee")';
    

    I’m using the very latest release.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Another couple of fixes is needed for multisite wp-cassify config backup to work:

    wp-cassify\admin\admin-menu.php::wp_cassify_export_configuration_options_settings() – replace false in the export function call with $wp_cassify_network_activated:

    			if (! empty( $_POST['wp_cassify_backup_plugin_options_settings'] ) ){
                            global $wp_cassify_network_activated;
    	        	$wp_cassify_backup_plugin_options_settings = WP_Cassify_Utils::wp_cassify_export_configuration_options( $wp_cassify_network_activated );
    	
    				nocache_headers();

    ————————

    wp-cassify\classes\wp_cassify_utils.php::wp_cassify_export_configuration_options() – network option key and value names differ, so need their own for loop

                    if ($wp_cassify_network_activated) {
                        $configuration_options = $wpdb->get_results("SELECT <code>meta_key</code>,</code>meta_value</code> FROM {$wpdb->prefix}sitemeta WHERE <code>meta_key</code> LIKE 'wp_cassify%' AND</code>meta_key</code> != 'wp_cassify_xml_response_value'");
                        foreach ($configuration_options as $configuration_option) {
                            $wp_cassify_export_configuration_options[$configuration_option->meta_key] = $configuration_option->meta_value;
                        }
                    } else {
                        $configuration_options = $wpdb->get_results("SELECT <code>option_name</code>,</code>option_value</code> FROM {$wpdb->prefix}options WHERE <code>option_name</code> LIKE 'wp_cassify%' AND</code>meta_key</code> != 'wp_cassify_xml_response_value'");
                        foreach ($configuration_options as $configuration_option) {
                            $wp_cassify_export_configuration_options[$configuration_option->option_name] = $configuration_option->option_value;
                        }
                    }
    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    The problem is that
    wp-cassify\admin\admin-menu.php::wp_cassify_create_network_menu() does not include these two hooks:

    		// Call export plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_export_configuration_options_settings' ) );
                    
                    // Call import plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_import_configuration_options_settings' ) );
    

    So testing in a single-site will not show the problem.

    I suggest adding them via abstracting the add_action statements that are common to multisite and single site:

    
    	/**
    	 *  Multisite and single-site add_action statements
    	 */                 
            function wp_cassify_add_admin_actions() {
    		// Add javascript needed by metaboxes
    		add_action( 'admin_init', array( $this , 'wp_cassify_add_metaboxes_js' ) );			 
    		 
    		// Call export plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_export_configuration_options_settings' ) );
                    
                    // Call import plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_import_configuration_options_settings' ) );
    		 
    		// Register differents metaboxes on admin screen.
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this, 'wp_cassify_register_metaboxes' ) );  
    		
    		// Add custom javascript functions specific to this plugin
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_add_custom_js' ) );
    	}
            
    	/**
    	 *  Add admin menu options
    	 */ 
    	public function wp_cassify_create_menu() {
    		$this->wp_cassify_admin_page_hook = add_options_page( $this->wp_cassify_plugin_datas['Name'] . ' Options', 
    			$this->wp_cassify_plugin_datas['Name'], 
    			'manage_options', 
    			'wp-cassify.php' , 
    			array( $this, 'wp_cassify_options' )
    		 );
                    
                    $this->wp_cassify_add_admin_actions();
            }
    	
    	/**
    	 *  Add admin menu options if plugin is activate over the network
    	 */         
    	public function wp_cassify_create_network_menu() {
    
    		$this->wp_cassify_admin_page_hook = add_submenu_page( 
                'settings.php',
                $this->wp_cassify_plugin_datas['Name'] . ' Options', 
    			$this->wp_cassify_plugin_datas['Name'], 
    			'manage_options', 
    			'wp-cassify.php' , 
    			array( $this, 'wp_cassify_options' )
    		 );
    
    		// Call register settings function
    		add_action( 'admin_init', array( $this , 'wp_cassify_register_plugin_settings' ) );
    
    		// Call register settings function
    		add_action( 'admin_init', array( $this , 'wp_cassify_register_plugin_settings' ) );
    
                    $this->wp_cassify_add_admin_actions();
    	}
    
    • This reply was modified 8 years, 1 month ago by buddywhatshisname. Reason: Remove error_log() statement
    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Found it – it’s More Privacy Options that is sending the emails and not your plugin.

    Thanks for the guidance!

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Strange. I’ve not gone premium or installed any of the premium addons, yet I’m getting emails. No matter – I’ll filter them with the wp_mail hook.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Hm no it’s still the same problem with a fresh, clean WP multisite install. It might just be PHP-FPM, but this comment seems to be true in my case:

    https://php.net/manual/en/ini.core.php#54186
    1. Apache checks to see if the target file exists.
    2. The prepend file is called

    I haven’t managed to find much other references about this yet.

    I will see if putting the auto_prepend_file into the .htaccess, php.ini or httpd.conf resolves the problem.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Hm OK – that’s must indeed be the case. I’ll selectively disable things and figure it out.
    Thanks for taking the time too reply wyfrann.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Thanks a ton wfalaa – worked great.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    I wasn’t clear enough 🙂
    I’m indeed clicking the ““Backup Plugin Configuration” button; id=”wp_cassify_backup_plugin_options_settings”. Tested also with
    jQuery(‘#wp_cassify_backup_plugin_options_settings’).click()
    No JS console errors show.

    Tested with WP 4.9 with no other plugins/themes and a clean nightly WP build; multisite; Chrome latest on Windows.

    The request is to
    /wp-admin/network/settings.php?page=wp-cassify.php
    and the request payload shows a form submission of the form data.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Thank you – great answer.

Viewing 15 replies - 16 through 30 (of 45 total)