One of our WordPress websites was running very slow, so I have been asked to diagnose the application. The website was running in upwards of 6 seconds to load the homepage, and 8+ seconds to load woocommerce product pages. There are several debugging and profiling tools available in the PHP realm, and Xdebug is an excellent choice. New Relic (free and premium versions) is another choice for profiling and debugging PHP applications.

How to display PHP errors?

On a production server, you will definitely want to turn off errors from displaying on the screen due to security and usability reasons but what do you do when you're on a development machine trying to debug a malfunctioning PHP script? PHP gives a programmer the ability to control the logging of errors, and the types of errors to be displayed. You may enable PHP error display in one of two ways.

I am kicking off a new PHP project with the Zend Framework 2 (ZF2) and chose to use Doctrine as the persistence layer with ORM capabilities. Knowing that I need two Zend modules for Doctrine support, I've cloned the two modules (DoctrineModule and DoctrineORMModule) from GitHub to enable doctrine support in my ZF2 project. Oops, just installing those two Zend modules from GitHub do not make doctrine work! What am I doing wrong? Do I need a core Doctrine library from doctrine-project.org installed in addition to those two modules in order to make this work in ZF2? After a careful review of documentation, the preferred installation method was using "composer" not "git clone".

One of the duties of a webmaster is to prevent spam bots from submitting web forms. If spammers are not blocked, the data collected from the visitors will contaminated with spam and it's a real nuisance to clean out this data every so often. I have been researching ways to block spam on the web forms we have on our website and found a solution that works reasonably well.

There are a number of array name/value pairs provided in the PHP's "predefined" $_SERVER variable, which you can use to extract client's IP address. Some of the IP-related $_SERVER parameters retrieved from the web server are passed by the client in the form of HTTP header, so they can be easily spoofed. Also, some of the HTTP_X_FORWARD* parameters expected to be filled by proxy servers may not always be there as not all proxy servers follow best practices.

Netsuite allows you to create a Custom Record to store a table of data collected from an external form. For example, you may create an email opt-in form on your external website, and submit the form to Netsuite. The submitted data will be processed by a Suitelet, and stored as a Custom Record in Netsuite. The form must be able to process concurrent users, and hence Suitelet is favored over SuiteTalk (Web Service). NetSuite web service has a concurrency problem, so SuiteTalk should not be used in this type of scenario.

Netsuite brands its web service integration services as SuiteTalk, and SuiteTalk allows third-party systems to communicate with NetSuite via SOAP-based APIs. To get started with Netsuite Webservice, you'll need a Netsuite account that you can use to communicate with Netsuite. You may sign up with the SuiteCloud Developer Network (SDN) as a Community member, and get a free Netsuite account for exploitation. It may take a day or two to get your account approved.