Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Just a small update to the script that carl provided. When I used it as he gave it it would not work as it ran before the #payment node was loaded. Updated it to check if the #payment node exists, if it does not wait 50ms and try again.

    	<script>
    	function removeExtraSquareInputOnCheckoutPage() {
     
      const squareWrapper = document.querySelector("#payment");
    if(!squareWrapper) {
            //The node we need does not exist yet.
            //Wait 50ms and try again
            window.setTimeout(removeExtraSquareInputOnCheckoutPage,50);
            return;
        }
     
      const observer = new MutationObserver(async () => {
        let numberOfInputs = 0;
        let numberOfSelectorQueries = 0;
    
        do {
       
          await delay(1000);
          const squareInputs = document.querySelectorAll(".sq-card-wrapper");
          numberOfSelectorQueries++;
          numberOfInputs = squareInputs.length;
    
          if (numberOfInputs > 1) {
            let i = 0;
            squareInputs.forEach(input => {
              if (i > 0) {
                console.log("Deleted duplicate Square Input");
                input.remove();
              }
              i++;
            });
          }
        } while (numberOfInputs < 1 && numberOfSelectorQueries < 10);
      });
     
      observer.observe(squareWrapper, {childList: true});
    }
    
    async function delay(delayTime) {
      return new Promise(resolve => setTimeout(resolve, delayTime));
    }
    	removeExtraSquareInputOnCheckoutPage();// JavaScript Document
    </script>
    cmbaker82

    (@cmbaker82)

    This is happening on one of my sites as well. Apparently started a couple days ago.
    woocommerce square plugin Version 2.9.1
    updating to new version of plugin fixed the issue

    Thread Starter cmbaker82

    (@cmbaker82)

    I am thinking that it may be a difference in how apache handles anonymous versus how IIS does.

    By default in IIS uses the IUSR account for anonymous access and not the application pool identity.

    I’m guessing on linux apache runs as the apache user even for anonymous logins, which would be equivalent of changing IIS anonymous user to run as the application pool identity.

    Thread Starter cmbaker82

    (@cmbaker82)

    So the default permissions for a wordpress install on linux which allows the upgrade to work are as follows:
    wordpress is in the html directory
    /var/www/html 755
    /var/www/html/* 644
    /var/www/html/<otherdirs> 755
    This works and allows wordpress to upgrade just fine
    all files and directories have apache as the owner and apache as the group.
    The permissions indicate that on directories the owner has read write execute and on files read and write.
    Other has read execute on directories and read on files

    The equivalent ntfs permissions should be that the applicationpool identity would have full control on everything, and anonymous would have only read permissions
    This however does not work.

    Thread Starter cmbaker82

    (@cmbaker82)

    Yes, I have other servers with wordpress running on linux. That doesn’t really help with fixing the problem at hand though.

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