Forum Replies Created

Viewing 15 replies - 31 through 45 (of 227 total)
  • Thread Starter ziegel

    (@ziegel)

    This technique only seemed to work for me. Some functions.php tasks stopped working.

    Thread Starter ziegel

    (@ziegel)

    Looks good!

    • This reply was modified 1 year, 7 months ago by ziegel.
    Thread Starter ziegel

    (@ziegel)

    I have generated a solution according to the first above link.

    1. Create a MU-PLUGIN in the folder: wp-content/mu-plugins of the name active-plugins.php
    <?php
    /**
     * @package active-plugins
     * @version 1.0
     *
     * Plugin Name: Active Plugins
     * Plugin URI: https://www.ads-software.com/extend/plugins/#
     * Description: This is a development plugin 
     * Author: Example
     * Version: 1.0
     * Author URI: https://example.com/
     */
    
    
    // shortcode to list active plugins 
    add_shortcode( 'activeplugins', function(){
    	
    	$active_plugins = get_option( 'active_plugins' );
    	$plugins = "";
    	if( count( $active_plugins ) > 0 ){
    		$plugins = "<ul>";
    		foreach ( $active_plugins as $plugin ) {
    			$plugins .= "<li>" . $plugin . "</li>";
    		}
    		$plugins .= "</ul>";
    	}
    	return $plugins;
    });
    
    $request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
    
    $is_admin = strpos( $request_uri, '/wp-admin/' );
    
    if( false === $is_admin ){
    	add_filter( 'option_active_plugins', function( $plugins ){
    
    		global $request_uri;
    
    		$is_regs_form = strpos( $request_uri, '/registration-form/' );
    		$is_tran_form = strpos( $request_uri, '/transaction-form/' );
    		$is_auth_form = strpos( $request_uri, '/signature-form/' );		
    			
    		$myplugins = array( 
    			"contact-form-7-signature-addon/signature.php" ,
    			"contact-form-cfdb7/contact-form-cfdb-7.php" ,
    			"cf7-conditional-fields/contact-form-7-conditional-fields.php"
    		);
    		if( (false ===  $is_regs_form) && (false === $is_tran_form) && (false === $is_auth_form ) ){
    			$plugins = array_diff( $plugins, $myplugins );
    		}
    		return $plugins;
    	} );
    }
    1. Then via ACF create a text field of different names for each form page (theme).
    2. Go to the WordPress pages of the forms and in the newly created separate fields (different name for each form) add the short code snippet: [activeplugins]
    3. Clear cache, and test to see when you upload a form page, that under browser INSPECTION -> Networks (refresh when you switch to Networks), you can see an element with the name beginning with sign*…
    4. Resources are not seen on other pages.
    Thread Starter ziegel

    (@ziegel)

    Hi,

    Can you please refer also to the below Yoast answer to a similar question?

    Jeroen Rotty (@jeroenrotty)
    1 hour, 50 minutes ago
    Hey @ziegel,
    
    Thank you for reaching out!
    
    We released 19.7 earlier today but reverted the release due to a bug in certain setups where the login screen/URL are customized. There was no feature or security fix in this release so the current version of Yoast SEO is now 19.6.1. We’ll release another version later with a patch so the bug is fixed in our new release.
    
    The notification of NinjaFirewall can be ignored.

    Hi @tsz01,

    I have found my root cause, which may be different than yours.

    I had some attributes around StepError which some how made the CLICK event of INPUT fields gain the prop/attribute of DISBALED up to the BootStrap breaking point of 992px decreasing to 991px screen width (minus the 17px scrolling bar).

    Hi @tsz01,

    I have also noticed something strange happening on your example:
    https://gassmann-seidel.de/20000120-nio/

    For the DIV element having the classes “kc-elm kc-css-597625 kc_col-sm-6 kc_column kc_col-sm-6”, the values of margin-top, padding-right, and padding-left, which are calculated as a percentage of total width, unexpectedly dramatically change at the point where screen width decreases from 992px to 991px.

    Any thoughts?

    Hi @tsz01,

    I could have isolated the issue to happening exactly when screen width decreases from 992px to 991px or narrower.

    I still haven’t isolated the root cause, however suspect it could be related to WP Bakery vc_secion or browser’s element styles. I have noticed, the css: left, padding-left and padding-right, may change from 0px to 1px.

    Also, please note this happens to me only on some forms.

    • This reply was modified 2 years, 7 months ago by ziegel.
    Thread Starter ziegel

    (@ziegel)

    May I suggest the plugin asks to send the email to early on login, where not all code is uploaded?

    Thread Starter ziegel

    (@ziegel)

    Note: This is the part of the code failing to recognize me as admin when MFA is atciated, and that ‘fires’ an email, which for some reason WP SES fails to take care of, with it

    add_action( 'wp_ajax_wposes_trigger_queue', array( $this, 'maybe_process_queue' ) );
    add_action( 'wp_ajax_nopriv_wposes_trigger_queue', array( $this, 'maybe_process_queue' ) ); 
    

    Mail Handler failing:

    
    /**
    	 * Mail handler
    	 *
    	 * @param string|array $to          The email recipient.
    	 * @param string       $subject     The email subject.
    	 * @param string       $message     The email message.
    	 * @param string|array $headers     The email headers.
    	 * @param string|array $attachments The email attachments.
    	 *
    	 * @return bool
    	 */
    	public function mail_handler( $to, $subject, $message, $headers, $attachments ) {
    		$content_type = apply_filters( 'wp_mail_content_type', 'text/plain' );
    
    		// Add Content-Type header now in case filter is removed by time queue is ran.
    		if ( 'text/html' === $content_type ) {
    			if ( is_array( $headers ) ) {
    				$headers[] = 'Content-Type: text/html;';
    			} else {
    				$headers = "Content-Type: text/html;\n" . $headers;
    			}
    		}
    
    		$subject  = $this->maybe_decode_subject( $subject );
    		$atts     = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
    		$email_id = $this->get_email_log()->log_email( $atts );
    
    		if ( false === $email_id ) {
    			return false;
    		}
    
    		if ( ! is_array( $attachments ) ) {
    			$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
    		}
    
    		foreach ( $attachments as $attachment ) {
    			$this->get_attachments()->handle_attachment( $email_id, $attachment );
    		}
    
    		$this->get_email_queue()->process_email( $email_id );
    		$this->trigger_queue();
    
    		return true;
    	}
    
    	/**
    	 * Sends an async request to trigger the queue if possible.
    	 *
    	 * @return bool
    	 */
    	
    
    	public function trigger_queue() {
    		// Make sure we're not DDOSing our own site.
    		if ( get_transient( 'wposes_triggered_queue' ) ) {
    			return false;
    		}
    
    		set_transient( 'wposes_triggered_queue', true, 10 );
    
    		$data = array(
    			'action' => 'wposes_trigger_queue',
    			'nonce'  => wp_create_nonce( 'wposes_trigger_queue' ),
    		);
    
    		$request_args = apply_filters(
    			'wposes_queue_request',
    			array(
    				'url'  => admin_url( 'admin-ajax.php' ),
    				'args' => array(
    					'timeout'   => 0.01,
    					'blocking'  => false,
    					'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
    					'body'      => $data,
    					'cookies'   => $_COOKIE,
    				),
    			)
    		);
    
    		$result = wp_remote_post( $request_args['url'], $request_args['args'] );
    
    		return ! is_wp_error( $result );
    
    	}
    

    Hi,

    On the ‘Setting’ tab, under ‘General’ have you chose the correct AWS “region’ where your SES is configured, and have you set your AWS suitable access key and secret under the ‘AWS Access Keys’ option on the far right?

    I think it solved when you contact the AWS support with a request to increase a resource limitation, where you provide explanation for your request.

    Have a look at their AWS post:

    https://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-quotas-request-increase.html

    Thread Starter ziegel

    (@ziegel)

    Below is some audit related information, assisting you focus on the problematic part of code:

    
     WP-Offload-SES.php
    
    	/**
    	 * Sends an async request to trigger the queue if possible.
    	 *
    	 * @return bool
    	 */
    	public function trigger_queue() {
    		// Make sure we're not DDOSing our own site.
    		if ( get_transient( 'wposes_triggered_queue' ) ) {
    			return false;
    		}
    
    		set_transient( 'wposes_triggered_queue', true, 10 );
    
    		$data = array(
    			'action' => 'wposes_trigger_queue',
    			'nonce'  => wp_create_nonce( 'wposes_trigger_queue' ),
    		);
    
    		$request_args = apply_filters(
    			'wposes_queue_request',
    			array(
    				'url'  => admin_url( 'admin-ajax.php' ),
    				'args' => array(
    					'timeout'   => 0.01,
    					'blocking'  => false,
    					'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
    					'body'      => $data,
    					'cookies'   => $_COOKIE,
    				),
    			)
    		);
    
    		$result = wp_remote_post( $request_args['url'], $request_args['args'] );
    
    		return ! is_wp_error( $result );
    	}
    
    
    array (
      0 =>
      array (
        'mo2fa_softtoken' => 'numer_removed',
        'miniorange_otp_token_submit' => 'Validate',
        'request_origin_method' => 'MO_2_FACTOR_CHALLENGE_GOOGLE_AUTHENTICATION',
        'miniorange_soft_token_nonce' => 'removed',
        'option' => 'miniorange_soft_token',
        'redirect_to' => '',
        'session_id' => 'xyz',
      ),
      1 =>
      array (
        'SERVER_SOFTWARE' => 'Apache',
        'REQUEST_URI' => '/wp-login.php',
        'USER' => 'exampleadmin',
        'HOME' => '/var/www/vhosts/example.com',
        'SCRIPT_NAME' => '/wp-login.php',
        'QUERY_STRING' => '',
        'REQUEST_METHOD' => 'POST',
        'SERVER_PROTOCOL' => 'HTTP/1.0',
        'GATEWAY_INTERFACE' => 'CGI/1.1',
        'REMOTE_PORT' => '34840',
        'SCRIPT_FILENAME' => '/var/www/vhosts/example.com/example.com/wp-login.php',
        'SERVER_ADMIN' => '[no address given]',
        'CONTEXT_DOCUMENT_ROOT' => '/var/www/vhosts/example.com/example.com',
        'CONTEXT_PREFIX' => '',
        'REQUEST_SCHEME' => 'https',
        'DOCUMENT_ROOT' => '/var/www/vhosts/example.com/example.com',
        'REMOTE_ADDR' => 'client ip',
        'SERVER_PORT' => '443',
        'SERVER_ADDR' => 'server ip',
        'SERVER_NAME' => 'example.com',
        'SERVER_SIGNATURE' => '',
        'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin',
        'HTTP_COOKIE' => '_gid=GA1.2.removed.removed; _ga_removed=GS1.1.1removed.1.0.1removed.0; _ga=GA1.1.removed.removed; PHPSESSID=xyz; example_identify_user=xyz; wordpress_test_cookie=removed%20Cookie%20check',
        'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9',
        'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br',
        'HTTP_REFERER' => 'https://example.com/wp-login.php',
        'HTTP_SEC_FETCH_DEST' => 'document',
        'HTTP_SEC_FETCH_USER' => '?1',
        'HTTP_SEC_FETCH_MODE' => 'navigate',
        'HTTP_SEC_FETCH_SITE' => 'same-origin',
        'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
        'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36 OPR/82.0.4227.33',
        'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
        'HTTP_ORIGIN' => 'https://example.com',
        'HTTP_UPGRADE_INSECURE_REQUESTS' => '1',
        'HTTP_SEC_CH_UA_PLATFORM' => '\\"Windows\\"',
        'HTTP_SEC_CH_UA_MOBILE' => '?0',
        'HTTP_SEC_CH_UA' => '\\"Chromium\\";v=\\"96\\", \\"Opera\\";v=\\"82\\", \\";Not A Brand\\";v=\\"99\\"',
        'HTTP_CACHE_CONTROL' => 'max-age=0',
        'CONTENT_LENGTH' => '332',
        'HTTP_CONNECTION' => 'close',
        'HTTP_X_ACCEL_INTERNAL' => '/internal-nginx-static-location',
        'HTTP_X_REAL_IP' => '212.143.153.203',
        'HTTP_HOST' => 'example.com',
        'proxy-nokeepalive' => '1',
        'HTTPS' => 'on',
        'HTTP_AUTHORIZATION' => '',
        'TZ' => 'Asia/Jerusalem',
        'PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY' => '0',
        'PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY' => '0',
        'good_ip' => '1',
        'SCRIPT_URI' => 'https://example.com/wp-login.php',
        'SCRIPT_URL' => '/wp-login.php',
        'UNIQUE_ID' => 'removed',
        'FCGI_ROLE' => 'RESPONDER',
        'PHP_SELF' => '/wp-login.php',
        'REQUEST_TIME_FLOAT' => removed,
        'REQUEST_TIME' => removed,
      ),
    )
    
    • This reply was modified 2 years, 11 months ago by ziegel.
    Thread Starter ziegel

    (@ziegel)

    SO, one of the bottom lines, would be, would the below plugin code work, or it would need an adjustment (due to server adding trailing slash):

    if ( @file_exists($nfw_['file'] = dirname($_SERVER['DOCUMENT_ROOT']) .'/.htninja') ||
    	@file_exists($nfw_['file'] = $_SERVER['DOCUMENT_ROOT'] .'/.htninja') ) {
    	$nfw_['res'] = @include_once $nfw_['file'];
    Thread Starter ziegel

    (@ziegel)

    It seems, your code, if made a small change to, would also work…

    Instead of a line with a slash before file name:
    include(dirname(getenv('DOCUMENT_ROOT') ) . '/.htninja');

    One without a slash, worked:
    include(dirname(getenv('DOCUMENT_ROOT') ) . '.htninja');

    getenv(‘DOCUMENT_ROOT’):
    DOCUMENT_ROOT : /var/www/vhosts/example.com/httpdocs

    dir(/var/www/vhosts/example.com/httpdocs):
    /var/www/vhosts/example.com

    And my server configured to add a trailing slash, would make this:
    /var/www/vhosts/example.com/

    And the the file name to add, in such a case, should be:
    '.htninja'

    And not:
    '/.htninja'

    • This reply was modified 2 years, 11 months ago by ziegel.
    Thread Starter ziegel

    (@ziegel)

    Hi @nintechnet,

    Thanks a lot! To begin with, you were right, and I found an error on my wp-config.php where the protective measure of setting if (!defined('ABSPATH')) exit; which may be used in other PHP files, and should NOT be used in wp-config.php was used. I fixed that.

    However, the code in wp-check.php line 139:
    include(dirname(getenv('DOCUMENT_ROOT') ) . '/.htninja');

    Did break the php working getting, to it.

    The same way used to call wp-config, DID WORK fall calling .htaccess:
    include(__DIR__ . '/.htninja');

    And I got full report that looks Ok.

    May I ask, is my Ninja Fire Wall found to be functioning, or there is still an open issue to fix?

    And, what caused the above failure, which did not occur for the fixed line?

    The report I got with the fix looks as the one below:

    NinjaFirewall (WP edition) troubleshooter
    HTTP server	:	Apache
    PHP version	:	7.4.27
    PHP SAPI	:	FPM-FCGI
     	 	 
    auto_prepend_file	:	/var/www/vhosts/example.com/httpdocs/wp-content/nfwlog/ninjafirewall.php
    Loader's path to firewall	:	/var/www/vhosts/example.com/httpdocs/wp-content/plugins/ninjafirewall/lib/firewall.php
    .htninja	:	found in /var/www/vhosts/example.com/.htninja
    wp-config.php	:	found in /var/www/vhosts/example.com/httpdocs/wp-config.php
    NinjaFirewall detection	:	NinjaFirewall WP Edition is loaded (Full WAF mode)
     	 	 
    Loaded INI file	:	/opt/plesk/php/7.4/etc/php.ini
    user_ini.filename	:	.user.ini
    user_ini.cache_ttl	:	300 seconds
    User PHP INI	:	.user.ini found -
     	 	 
    DOCUMENT_ROOT	:	/var/www/vhosts/example.com/httpdocs
    ABSPATH	:	/var/www/vhosts/example.com/httpdocs/
    WordPress version	:	5.8.2
    WP_CONTENT_DIR	:	/var/www/vhosts/example.com/httpdocs/wp-content
    Plugins directory	:	/var/www/vhosts/example.com/httpdocs/wp-content/plugins
    User Role	:	Administrator
    User Capabilities	:	manage_options: OK - unfiltered_html: OK
    Log dir permissions	:	/var/www/vhosts/example.com/httpdocs/wp-content/nfwlog dir is writable
    Cache dir permissions	:	/var/www/vhosts/example.com/httpdocs/wp-content/nfwlog/cache dir is writable
    NinjaFirewall (WP edition) troubleshooter v1.9.4
Viewing 15 replies - 31 through 45 (of 227 total)